Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to send MSGID & CORRELID for the Message Type REQUEST

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
Sathiyendran

New User


Joined: 17 Jul 2015
Posts: 5
Location: India

PostPosted: Mon Jul 20, 2015 2:08 pm    Post subject: How to send MSGID & CORRELID for the Message Type REQUEST
Reply with quote

Need to send a message to the another application with MsgId and CorrelId , this message require a response. Below option was used in cobol code

MOVE MQMT-REQUEST TO MQMD-TYPE
MOVE MQMI-NONE TO MQMD-MSD-ID
MOVE MQCI-NONE TO MQMD-CORRELID

After writing the the data thru MQPUT/MQPUT1, we need to retrieve the corresponding response from Reply MQ. If we use below option, how program knows this a reponse for the earlier message sent.

MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID.

CALL 'MQGET' USING MQ-HCONN
MQ-NATIVE-HOBJ
MQMD
MQGMO

how source system know the MsgId and CorrelId for the each message sent to destination application ? because source system must know the MsgId and CorrelId to read the corresponding response from Reply MQ
Back to top
View user's profile Send private message

Sathiyendran

New User


Joined: 17 Jul 2015
Posts: 5
Location: India

PostPosted: Wed Jul 22, 2015 2:53 pm    Post subject: Reply to: How to send MSGID & CORRELID for the Message Type REQUEST
Reply with quote

This was the code written to send a message to another application.

MOVE WS-QUEUE-ALIAS TO MQOD-OBJECTNAME.
MOVE WS-REPLY-QUEUE-ALIAS TO MQMD-REPLYTOQ
MOVE SPACES TO MQMD-REPLYTOQMGR
MOVE MQMT-REQUEST TO MQMD-MSGTYPE
MOVE MQMI-NONE TO MQMD-MSGID
MOVE MQMI-NONE TO MQMD-CORRELID
MOVE MQPER-PERSISTENT TO MQMD-PERSISTENCE.

COMPUTE MQPMO-OPTIONS = MQPMO-SYNCPOINT
+ MQPMO-NEW-MSG-ID
+ MQPMO-NEW-CORREL-ID
+ MQPMO-FAIL-IF-QUIESCING.

DISPLAY 'NEW MSG ID : ' MQMD-MSGID
DISPLAY 'NEW COR ID : ' MQMD-CORRELID

CALL 'MQPUT1' USING MQ-HCONN,
MQ-OBJ-DESCRIPTOR,
MQ-MSG-DESCRIPTOR,
MQ-PUT-OPTIONS,
MQ-MESSAGE-LENGTH,
MQ-MESSAGE-DATA,
MQ-COMPLETION-CODE,
MQ-REASON.

Please review and update whether the above code will generate MsgId and correlId and sent to another app.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Wed Jul 22, 2015 5:43 pm    Post subject:
Reply with quote

What is wrong with your testing system?
Back to top
View user's profile Send private message
Sathiyendran

New User


Joined: 17 Jul 2015
Posts: 5
Location: India

PostPosted: Thu Jul 23, 2015 1:39 pm    Post subject:
Reply with quote

I'm able to place a message successfully. When I need to retrieve the corresponding response from Reply MQ, I would need the MsgId and CorrelId.

how do I know these ?

Receiver might received the MsgId and CorrelId and they will reply based on this but when we retrieve we need to supply the ids to get corresponding response .. correct ?
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Jul 23, 2015 2:07 pm    Post subject:
Reply with quote

The process for matching MsgId/CorrelId is very straightforward and requires collaboration between the message sender (client) and the responder (server).

By coding
Code:
MOVE MQMI-NONE TO MQMD-MSGID.
the client MQPUT(1) causes MQ to populate the MsgId field in the request message descriptor with a value unique to that QManager. This then flows with the message to the server.

At the server side, the receiving application's MQGET retrieves this MsgId and the application then places it in the CorrelId field of the reply message's message descriptor.

At the client side, the client application places the MsgId which was generated (available after the MQPUT(1)) in the CorrelId field of the message descriptor for the MQGET.

Since the MsgId and CorrelId are being moved between request and response, it is good practice to have separate message descriptors for each in the applications.

Hope this clarifies,,

Garry.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts How to show message using batch jobs madprasy TSO/ISPF 7 Fri Sep 09, 2016 6:55 pm
No new posts Truncated error message after VERIFY ... David Sde TSO/ISPF 4 Mon Sep 05, 2016 11:26 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts Send parameter for macro STIMERM from... Daniel Teolotitla PL/I & Assembler 13 Tue Jul 05, 2016 9:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us