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 API Support » How to copy msgs from local q to remote q

Post new topic  Reply to topic
 How to copy msgs from local q to remote q « View previous topic :: View next topic » 
Author Message
beth_carlin
PostPosted: Thu Sep 21, 2006 8:22 am    Post subject: How to copy msgs from local q to remote q Reply with quote

Acolyte

Joined: 08 Jun 2004
Posts: 64

H MQ APIs gurus,
I wrote a program to copy from local Q1 to local Q2 and it works ok

I am trying to modify to to copy from local Q1 to remote RQ2 but it keeps failing. I think my OputOptions is not correct.

Would you help me.

This is my current code fragment

putOpts = new MQPutMessageOptions();
getOpts = new MQGetMessageOptions();
.......
oOpts = MQC.MQOO_BROWSE | MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE;
SourceQ = SourceQMgr.accessQueue(qtProperties.getProperty("sourceQueue"), oOpts, null, null, null);
TargetQ = TargetQMgr.accessQueue(qtProperties.getProperty("targetQueue"), oOpts, null, null, null);
qDepth = SourceQ.getCurrentDepth();
for (long i = qDepth; i > 0; i--) {
SourceQ.get(TheMessage, getOpts);

TargetQ.put(TheMessage, putOpts);

........
;
}
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 21, 2006 8:44 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Yes. Your OputOptions are not correct.

Almost nobody ever uses the same options for a queue that they are opening for input and a queue that they are opening for output.

Usually because you can't GET from a qremote.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Sep 21, 2006 8:47 am    Post subject: Reply with quote

Jedi Knight

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

Try
Quote:
oOpts = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING ;
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tleichen
PostPosted: Fri Sep 22, 2006 7:53 am    Post subject: Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

Also, read the error codes explanation in the Messages manual. You will learn more about your mistakes that way and understand the API better.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
klabran
PostPosted: Fri Sep 29, 2006 8:28 am    Post subject: Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

As an FYI....

The RFHUtil program (IH03 support pack) can do this and it can even be scripted against....
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 API Support » How to copy msgs from local q to remote q
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.