|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Correlation and Message Id |
« View previous topic :: View next topic » |
Author |
Message
|
jcsdgdl |
Posted: Wed May 19, 2004 7:19 am Post subject: Correlation and Message Id |
|
|
Newbie
Joined: 13 May 2004 Posts: 2 Location: MEXICO
|
Hi everybody... I have problems with correlation and message Id. I dont know how exactly they work..
We have the MQ Server on WINDOWS 2003 which communicates with Mainframe.
In MQ exist :
Channel Client : MQ1200.CHL
Queue Manager : MQ1200
Remote Queue : MRD.MQ1200.SEND (this send the message to mainframe)
Local Queue : MLD.MQ1200.RECV
I put this properties to the message :
MQEnvironment.hostname = "MY HOST";
MQEnvironment.channel = "MQ1200.CLIENT.CHL";
MQEnvironment.port = 1415;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
qManager = new MQQueueManager("MQ1200");
int queueOpenOptions = MQC.MQOO_OUTPUT |MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_SET_IDENTITY_CONTEXT;
requestQ = qManager.accessQueue( "QRD.MQ1200.ENVIO", queueOpenOptions, "MQ1200", null, null );
MQPutMessageOptions mqpmo = new MQPutMessageOptions();
mqpmo.options = mqpmo.options | MQC.MQPMO_NEW_MSG_ID;
mqpmo.options = mqpmo.options | MQC.MQPMO_SET_IDENTITY_CONTEXT;
MQMessage mqRequest = new MQMessage();
mqRequest.applicationIdData = "INCLIENTINQUIRY";
mqRequest.expiry = 600;
mqRequest.format = MQC.MQFMT_STRING;
mqRequest.messageType = MQC.MQMT_REQUEST;
mqRequest.persistence = MQC.MQPER_NOT_PERSISTENT;
mqRequest.priority = 5;
mqRequest.replyToQueueManagerName = "MQ1200";
mqRequest.replyToQueueName = "QRD.MQ1200.RESP";
String messageId = "B401";
mqRequest.messageId = messageId.getBytes();
String correlationId = "00010001631010000078";
mqRequest.correlationId = correlationId.getBytes();
mqRequest.writeString( requestMessage );
requestQ.put( mqRequest, mqpmo );
The message is put in the remote queue, then is send to the mainframe, the mainframe answer to the local queue and when I see the correlation a message id is diferente.. gets some like this :
ID :[B@2dacd1 Correlation ID :[B@2d086a
Am I doing something wrong... can I put the correlation and message id in a remote queue?
Thanks a lot. _________________ Juan Carlos Santillan Dueñas
Getronics CP Mexico |
|
Back to top |
|
 |
vadivel |
Posted: Wed May 19, 2004 6:04 pm Post subject: |
|
|
 Voyager
Joined: 05 Aug 2002 Posts: 79 Location: US
|
You can set the Message id and Correlation id of the message, while sending it. Probaly try removing the MQC.MQPMO_NEW_MSG_ID in the put message option.
I believe you are using a request/reply scenario. In this case the mainframe system has to get the message id from the message that you send and set the correlation id of the reply message to this value.
When you get the response you can check the correlation id to check for which request this response has come.
Hope this helps.
Regards
Vels |
|
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
|
|
|
|