|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to retrieve a specific message from Queue |
« View previous topic :: View next topic » |
Author |
Message
|
magesh_chandren |
Posted: Thu Apr 01, 2004 7:48 am Post subject: How to retrieve a specific message from Queue |
|
|
Novice
Joined: 16 Feb 2004 Posts: 12
|
Hi All,
Iam using MQ Java client to connect to a MQ Server. This is what I do in steps.
1. Access a queue (say Q1) and put a message MSG1 into it
2. Another program waits for a message on this request queue(Q1) and puts a message MSG2 into another queue(Q2) with the correlation ID of MSG2 to be the messageID of MSG1
ie MSG2.correlationID = MSG1.messageID
3. I wait for a message on Q2 with a message whose correlation ID is MSG1.messageID
For the above sequence of steps, sometimes I receieve messages for which Iam not actually waiting for. Can anyone help me on this ? Where am I exactly going wrong.
FYI, I checked the message ID of MSG1. Each time I put this into the Queue, it is unique. So there could be only one unique incoming message on Q2. But how is that I receive someother message and not the intended one ?
This is the actual code Iam using
//************Start Code***************
openOptions = MQC.MQOO_INPUT_SHARED | MQC.MQOO_ALTERNATE_USER_AUTHORITY;
replyQueue = qMgr.accessQueue(mqSet.queueRply,openOptions,null,null,mqSet.queueUID);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.waitInterval = Integer.parseInt(mqSet.rpcWait);
gmo.options = MQC.MQGMO_WAIT;
gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
MQMessage retrievedMessage = new MQMessage();
retrievedMessage.correlationId = sendingMsg.messageId;
replyQueue.get(retrievedMessage,gmo);
//***************End Code***************
Pls Help!!
Thanks & Regards
Magesh |
|
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
|
|
|
|