|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[SOLVED]Move Messages while preserving all context |
« View previous topic :: View next topic » |
Author |
Message
|
scar |
Posted: Mon Nov 02, 2015 8:43 am Post subject: [SOLVED]Move Messages while preserving all context |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
I am trying to move messages from one Q to another and passing all the context
Code: |
//Options for opening the Read Q
int openInputOptions = CMQC.MQOO_FAIL_IF_QUIESCING + CMQC.MQOO_INPUT_SHARED +
CMQC.MQOO_BROWSE + CMQC.MQOO_INQUIRE + CMQC.MQOO_SAVE_ALL_CONTEXT;
//Options for opening the Write to Q
int openOutputOptions = CMQC.MQOO_OUTPUT | CMQC.MQOO_PASS_ALL_CONTEXT |
CMQC.MQOO_INQUIRE |CMQC.MQOO_FAIL_IF_QUIESCING;
// Get msg options
gmo.options = CMQC.MQGMO_SYNCPOINT| CMQC.MQGMO_NO_WAIT + CMQC.MQGMO_FAIL_IF_QUIESCING ;
//Put msg optiong
pmo.options = CMQC.MQPMO_SYNCPOINT | CMQC.MQPMO_PASS_ALL_CONTEXT ;
//When executing put to Q, i am getting the following exception
MQJE001: Completion Code '2', Reason '2097'.
com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2097'.
at com.ibm.mq.MQDestination.put(MQDestination.java:1146)
at MoveAllMessages.run(MoveAllMessages.java:313) |
Any clues on what I am getting wrong....Thanks.
Last edited by scar on Mon Nov 02, 2015 9:03 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 02, 2015 8:50 am Post subject: Re: Move Messages while preserving all context |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
scar wrote: |
Any clues on what I am getting wrong |
According to this:
Quote: |
the handle specified in the Context field of the PutMsgOpts parameter is either not a valid queue handle, or it is a valid queue handle but the queue was not opened with MQOO_SAVE_ALL_CONTEXT |
I see you using MQOO_SAVE_ALL_CONTEXT in the input options, but I don't see where you're setting the Context for the output. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
scar |
Posted: Mon Nov 02, 2015 9:02 am Post subject: |
|
|
Centurion
Joined: 23 Jun 2004 Posts: 145
|
Yeap , got it, missed settinghte context Ref. Thanks.
pmo.contextReference=mqGetqueue; |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|