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 » IBM MQ Java / JMS » [SOLVED]Move Messages while preserving all context

Post new topic  Reply to topic
 [SOLVED]Move Messages while preserving all context « View previous topic :: View next topic » 
Author Message
scar
PostPosted: Mon Nov 02, 2015 8:43 am    Post subject: [SOLVED]Move Messages while preserving all context Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Nov 02, 2015 8:50 am    Post subject: Re: Move Messages while preserving all context Reply with quote

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
View user's profile Send private message
scar
PostPosted: Mon Nov 02, 2015 9:02 am    Post subject: Reply with quote

Centurion

Joined: 23 Jun 2004
Posts: 145

Yeap , got it, missed settinghte context Ref. Thanks.

pmo.contextReference=mqGetqueue;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » [SOLVED]Move Messages while preserving all context
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.