Author |
Message
|
rajmq |
Posted: Thu Mar 27, 2003 5:56 am Post subject: MessageId mapping Using ESQL... |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
I am Using MQ5.2.1 and WMQI2.1 for Application.
Using the java Client Program is setting messageId='XXX' and i am putting that value to inputQ which is assigned to MQInputNode
My Message Flow Diagram
MQInputNode----->ComputeNode------> PublicationNode
Here Probelm is i am able to see the same messageId (XXX) in inputQ.
once it is published to my Received application there the messageId different.But i checked the same message in inputQ there messageId is XXX.
In Compute i am setting below ESQL Commands
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQRFH2.psc.Command = 'Publish' ;
SET OutputRoot.MQRFH2.psc.Topic = 'XXXXX' ;
SET OutputRoot.XML = InputRoot.XML;
After Publishing How can i get same messageId??
can anyone help me out !!
regards
raj |
|
Back to top |
|
 |
mcatama |
Posted: Thu Mar 27, 2003 6:26 am Post subject: |
|
|
Novice
Joined: 10 Apr 2002 Posts: 17
|
Hi Raj,
The following is an extract from the WMQI 2.1 Programming Guide, Chapter 5 in the section 'MQMD for publications forwarded by a broker':
Quote: |
This section describes the message descriptor for messages sent by the broker to
subscribers.
All fields in the MQMD, except those listed below, are set to their default values.
MsgId Will be set to a unique value.
|
According to this it will always set the MsgId to a unique value. Perhaps you could store the MsgId somewhere else in the message for your receiving application to retrieve it, such as a field in the 'usr' folder of the MQRFH2 header?
Alison |
|
Back to top |
|
 |
rajmq |
Posted: Thu Mar 27, 2003 10:58 pm Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
Thanks for Reply
Already each application setting MsgId is Unique value only.it may differenet to each application.So i don't want to keep the this unique value to inside the receiver message.
Suppose i am keeping the this info to usr folder.The problem is the receiver side after getting the message i am removing the header information, i am reading only message.
But one thing i am not understanding other MQMD parameters(like ReplyQ, Expiry and MsgType) are same after publishing by boker.
Why the messageId only is different??
Using the Compute is it possible to set messageId value.I???
was tried like
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQRFH2.psc.Command = 'Publish' ;
SET OutputRoot.MQRFH2.psc.Topic = 'XXXXX' ;
SET OutputRoot.MQMD.messgeId = 'XXX' ;
SET OutputRoot.XML = InputRoot.XML;
I am getting some other messageId in the receiver queue.
anything wrong in the above setup??
regards
raj  |
|
Back to top |
|
 |
mcatama |
Posted: Fri Mar 28, 2003 1:34 am Post subject: |
|
|
Novice
Joined: 10 Apr 2002 Posts: 17
|
Hi,
If you check out the document referenced above it gives full details of how the broker sets each field in the MQMD for a published message.
In some cases the values from the original message are retained (e.g. Expiry field), in other cases it will generate a new value (e.g. MsgId), and in other cases it will set a default value. ( e.g. Report field)
This means that for these fields where it generates a new value or sets a default value, it does not matter what you set in the ESQL code before the publish, the broker will overwrite it. As far as I know there is no way around this.
Alison |
|
Back to top |
|
 |
rajmq |
Posted: Fri Mar 28, 2003 10:04 pm Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
In ESQL before publishing i am setting messaeId is unique value.
But i am not able to see same messageId in receiving application queue.
queuemanager is creating different messageId.
I am posting my ESQL Here..
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQMD.messgeId = 'XXX' ; ///here i am assiging ..but it is different in the queue
SET OutputRoot.MQRFH2.psc.Command = 'Publish' ;
SET OutputRoot.MQRFH2.psc.Topic = 'XXXXX' ;
SET OutputRoot.XML = InputRoot.XML
can anyone help me for above prob..
regards
raj |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Mar 29, 2003 12:35 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
mcatama already answered this question.
The broker will always reset the MessageID to a new value when it publishes the message. This happens after your ESQL code, and you can't change it. |
|
Back to top |
|
 |
rajmq |
Posted: Tue Apr 01, 2003 10:12 pm Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
Thanks to all
Generally we are using MessaeId and CorrelationId fields for identication of response message. So It is only applicable for MQSeries Pt to Pt communication. The same pub/sub we can't use the MsgId and CorrId for Identify.
because while publishing broker is assigning new values for MsgId and corrId.
If i am wrong pl correct me and How to slove the above probs??
can anybody help me
regards
raj |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 02, 2003 6:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
This should really be in the WMQI board, and not this one.
I haven't worked with pub/sub a lot yet, but here's a couple of thoughts.
You could use the publication topics to include an id to correlation your reply with a request. Heck, you could even use the original MsgID and CorrelID values. Just put them as additional levels of topics, i.e. 'topicRoot/topicCategory/topic/topic/MsgID/CorrelID' as your topic.
Or you create an extra field or two in your message to store your MsgId and CorrelIDs, or any other value that you want to use to correlate a response to a reply.
I'm not sure why you're using pub/sub for a request/reply design, though. It is really more of a point-to-point design than a one-to-many design. |
|
Back to top |
|
 |
rajmq |
Posted: Wed Apr 02, 2003 8:02 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
I full idea is we don't keep the msgId, corrId or any kind of properties variable inside the Application message.we need to keep these properties in MQ level.But broker is handling in different way.......
ok anyother suggestions ........
thanks for Reply
raj |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 02, 2003 8:18 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, you could put your message id data into another folder in the RFH2 header.
That wouldn't mess with your topic hierarchy, or your application data. |
|
Back to top |
|
 |
rajmq |
Posted: Wed Apr 02, 2003 10:29 pm Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
I think i mentioned already this point,
Suppose i am keeping my referernce another folder in the RFH2 header,the problem is after getting our receiving application removing the RFH2 header information and it is reading only applicationMessage.
thanks
raj |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 03, 2003 7:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, you did mention that, and I didn't notice.
But I think there isn't any solution to the problem the way you want it to work. Pub/Sub is not designed to support request/reply patterns. Request/Reply is really supposed to be a one-to-one design, and not a one-to-many design.
What are you trying to accomplish by using Pub/Sub that you can't do with a "normal" request/reply? |
|
Back to top |
|
 |
rajmq |
Posted: Fri Apr 04, 2003 5:26 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
Hi
Think is already one application is using MQ5.2 and Wmqi2.1 pub/sub.
Now we are trying to plugin new system to old application,their i need this scenerio.
regards
raj |
|
Back to top |
|
 |
|