ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » How to set persistence for the message in JAVA

Post new topic  Reply to topic
 How to set persistence for the message in JAVA « View previous topic :: View next topic » 
Author Message
prithun
PostPosted: Sat Mar 04, 2006 6:45 am    Post subject: How to set persistence for the message in JAVA Reply with quote

Apprentice

Joined: 08 Apr 2005
Posts: 33

I have a JAVA application in which I needed to set persistence options.
I found that in C++ we use setPersistence() function.
But I couldn't find any in JAVA.
Can anybody help.
Back to top
View user's profile Send private message
wschutz
PostPosted: Sat Mar 04, 2006 8:31 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

JMS or BASE classes?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
prithun
PostPosted: Sun Mar 05, 2006 12:38 am    Post subject: Reply with quote

Apprentice

Joined: 08 Apr 2005
Posts: 33

I am not using JMS
Back to top
View user's profile Send private message
wschutz
PostPosted: Sun Mar 05, 2006 4:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

have at look at the MQMD class, which has this field:

Quote:
persistence

public int

The message persistence. The following values are defined:

* MQC.MQPER_PERSISTENT
* MQC.MQPER_NOT_PERSISTENT
* MQC.MQPER_PERSISTENCE_AS_Q_DEF

The default value is MQC.MQPER_PERSISTENCE_AS_Q_DEF

_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
prithun
PostPosted: Sun Mar 05, 2006 5:12 am    Post subject: Reply with quote

Apprentice

Joined: 08 Apr 2005
Posts: 33

Should we set these options in the Queue open Options as
int openOptions = MQC.MQPER_PERSISTENT + (other options that I am already using such as MQC.MQOO_INPUT_AS_Q_DEF+MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING+ MQC.MQOO_INQUIRE).

qMgr.accessQueue("TEST_QUEUE",openOptions);

Appreciate your help.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sun Mar 05, 2006 5:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

prithun wrote:
Should we set these options in the Queue open Options as
int openOptions = MQC.MQPER_PERSISTENT + (other options that I am already using such as MQC.MQOO_INPUT_AS_Q_DEF+MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING+ MQC.MQOO_INQUIRE).


Does it work if you try that?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Sun Mar 05, 2006 5:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

its generally NOT a good idea to try and mix MQPER_* options with MQOO_* options.....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
prithun
PostPosted: Sun Mar 05, 2006 6:07 am    Post subject: Reply with quote

Apprentice

Joined: 08 Apr 2005
Posts: 33

I would appreciate if you suggest me how should I use the MQPER option. Note that I am not using JMS. Its a simple publish/subscribe mechanism.
Back to top
View user's profile Send private message
wschutz
PostPosted: Sun Mar 05, 2006 6:30 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

prithun wrote:
I would appreciate if you suggest me how should I use the MQPER option. Note that I am not using JMS. Its a simple publish/subscribe mechanism.
I thought I already did..... you set a field in the MQMD class and use that when putting the message.... have you looked at the "Using Java" manual?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
vennela
PostPosted: Sun Mar 05, 2006 11:05 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

If using 5.3 classes then
Code:
MQMessage.persistence = MQC.MQPER_PERSISTENT
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » How to set persistence for the message in JAVA
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.