Posted: Wed May 06, 2009 11:07 am Post subject: MQ Request Reply Program on AS400 using RPG ILE
Newbie
Joined: 06 May 2009 Posts: 2
Hello,
I am trying to write MQ Program using RPG ILE on AS400. The program is request type and I want get message using Correlation ID.
When I put i am using following option.
C Z-ADD MTRQST MDMT
C Z-ADD ROCMTC MDREP
The receiving program processes the messages and sends back the message Id in correlation ID field.
When I do get I am using
C GMWT ADD GMATM GMOPT
C ADD MOCORI GMMO
and
C MOVEL MINONE MDMID
C MOVEL CINONE MDCID
C MOVEL MDMID MDCID
it is getting all the messages instead of getting just the message with matching correlation ID.
Please let me know what are the correct parameters I need to use to get only those messages that matches the correlation id.
I see that you are clearing the msgid and correlid using MQMI_NONE and MQCI_NONE. Are you sure that before you do the get you are correctly moving the msgId of the previous message to the correlId of the MQMD?
From the behavior you display this does not seem to be the case.
Hi,
Here is the complete get code. I am moving message ID to correlation ID before get.but it does nothing.I have similar program in Java and C-Sharp ..They do get the message with matching correlation ID.But i dont know may i am doing something wrong in RPG ILE.
C MOVE OCODE CCODE
C MOVEL MDMID MDCID
** first 70 bytes of replies only
C Z-ADD 70 BUFLEN
** 5 minute limit for first reply, reduced for later message
C Z-ADD 60000 GMWI
*
** Start loop to get messages
C CCODE DOWNE CCFAIL
*
C** MOVE MDMID MDCID
C** GET options are Wait and Accept-truncated-message
C GMWT ADD GMATM GMOPT
C ADD MOCORI GMMO
C** clear answer because MQGET only fills to length of message
C MOVEL *BLANKS ANSWER 70
* call ...
C CALLP MQGET(HCONN : HREPLY : MQMD : MQGMO :
C BUFLEN : ANSPTR : MSGLEN : CCODE :
C REASON)
*
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