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 » Cop msg between queues with save contex

Post new topic  Reply to topic
 Cop msg between queues with save contex « View previous topic :: View next topic » 
Author Message
kurt
PostPosted: Thu Jul 03, 2008 3:10 am    Post subject: Cop msg between queues with save contex Reply with quote

Newbie

Joined: 03 Jul 2008
Posts: 2

Hello,

i tried to write some java-code to copy a message from a source queue to a destination queue.

I got the RC=2098.
This means, the source queue was open with:
MQConstants.MQOO_BROWSE|MQConstants.MQOO_SAVE_ALL_CONTEXT

I want to keep the contex like to tool ma01.

Here some code from putting the message:
...
int putopenptions=MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT;
MQQueue queue2=null;
MQMessage message2=new MQMessage();
putopenptions=MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT|MQConstants.MQOO_PASS_ALL_CONTEXT;
putMessageOptions=new MQPutMessageOptions();
putMessageOptions.contextReference=sourcequeue;//set contex from source queue

putMessageOptions.options=MQConstants.MQPMO_NEW_CORREL_ID|MQConstants.MQPMO_NEW_MSG_ID|MQConstants.MQPMO_PASS_ALL_CONTEXT;
queue2 = qMgr.accessQueue("TESTQ", putopenptions);
message2.writeChars(msgText);
...

Is there any possible to handle this issue.

Thanks.
queue2.put(message2,putMessageOptions);
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Thu Jul 03, 2008 9:17 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Go download and review a java sample call Backout from the following web page:
http://www.capitalware.biz/mq_code_java.html

It moves a message from one queue to another and it keeps message context.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
kurt
PostPosted: Fri Jul 04, 2008 3:53 am    Post subject: Reply with quote

Newbie

Joined: 03 Jul 2008
Posts: 2

Thanks,

but i wan't to move message.

I browse the particular message and save the context. After this, i would like put the message, as into another queue at the same QMGR.

Does anybody, how this handle the tool "ma01"?

Example:
"Copy messages between Queues : q -iQ1 -oQ2"

rg Michael D.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Jul 04, 2008 8:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

kurt wrote:
but i wan't to move message.


Then change the Destructive Get to a Non-destructive Get (Browse)!!

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Cop msg between queues with save contex
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.