|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to copy msgs from local q to remote q |
« View previous topic :: View next topic » |
Author |
Message
|
beth_carlin |
Posted: Thu Sep 21, 2006 8:22 am Post subject: How to copy msgs from local q to remote q |
|
|
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 |
|
 |
jefflowrey |
Posted: Thu Sep 21, 2006 8:44 am Post subject: |
|
|
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 |
|
 |
vennela |
Posted: Thu Sep 21, 2006 8:47 am Post subject: |
|
|
 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 |
|
 |
tleichen |
Posted: Fri Sep 22, 2006 7:53 am Post subject: |
|
|
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 |
|
 |
klabran |
Posted: Fri Sep 29, 2006 8:28 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|