Author |
Message
|
prithun |
Posted: Sat Mar 04, 2006 6:45 am Post subject: How to set persistence for the message in JAVA |
|
|
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 |
|
 |
wschutz |
Posted: Sat Mar 04, 2006 8:31 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
JMS or BASE classes? _________________ -wayne |
|
Back to top |
|
 |
prithun |
Posted: Sun Mar 05, 2006 12:38 am Post subject: |
|
|
Apprentice
Joined: 08 Apr 2005 Posts: 33
|
|
Back to top |
|
 |
wschutz |
Posted: Sun Mar 05, 2006 4:47 am Post subject: |
|
|
 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 |
|
 |
prithun |
Posted: Sun Mar 05, 2006 5:12 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Sun Mar 05, 2006 5:27 am Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Sun Mar 05, 2006 5:52 am Post subject: |
|
|
 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 |
|
 |
prithun |
Posted: Sun Mar 05, 2006 6:07 am Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Sun Mar 05, 2006 6:30 am Post subject: |
|
|
 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 |
|
 |
vennela |
Posted: Sun Mar 05, 2006 11:05 pm Post subject: |
|
|
 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 |
|
 |
|