IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help in retrieving correlid of a message


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
veeruspi

New User


Joined: 29 Dec 2005
Posts: 16
Location: mysore

PostPosted: Mon Mar 14, 2011 3:41 pm
Reply with quote

Hi All,
I have a requirement where in I have 2 transactions, namely TRN1 and TRN2. TRN1 will put a message onto Queue1. When a message in put onto Queue1, TRN2 is triggered in the background. It does a get from Queue1 and processes the message and put the response onto Queue2. In my first program, after putting a message onto queue1, I am trying to get the response message from queue2 after 20 seconds delay. Here inorder to identify the message I have used MQPMO-NEW-CORREL-ID in MQPMO options in first program and I have saved MQPMO-NEW-CORREL-ID in working storage variable to use it while getting the message. Here my question is how can we get the correlid of a message in queue1 in second program so that same can be used while putting a message onto queue2?

Thanks
Veeru
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Mar 15, 2011 8:49 pm
Reply with quote

The way you describe is not the standard way to achieve what you want.

Standard practice is for TRN1 to issue MQPUT(1) to put a message on Queue1. This returns a MsgId in the Message Descriptor (MQMD) to TRN1 application. This is then put into the MQMD.CorrelId for the MQGET of the reply message which TRN1 issues.

The message that was MQPUT(1) carries the MsgId in its Message Descriptor and this is presented to TRN2 along with the name of the ReplytoQ. TRN2 then moves this MsgId to the CorrelId field of the reply which it will MQPUT(1) to Queue2 (the ReplytoQ) and a new MsgId is generated for the reply.

In this way, TRN1 always issues an MQGET for the message with a CorrelId that matches the MsgId from the MQPUT(1).

Hope this helps,
Garry.
Back to top
View user's profile Send private message
veeruspi

New User


Joined: 29 Dec 2005
Posts: 16
Location: mysore

PostPosted: Fri Mar 18, 2011 10:57 am
Reply with quote

Thanks Garry. It was very informative and helped me alot.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. how can I proof that message was post... Java & MQSeries 1
No new posts IMS Message : DFS3577A IMS DB/DC 4
No new posts dsnrexx fails without error message CLIST & REXX 9
No new posts Print out all lines with 'IBM' compil... CLIST & REXX 8
No new posts How to get the message id thats trigg... Java & MQSeries 0
Search our Forums:

Back to Top