Author |
Message
|
Bartez75 |
Posted: Tue Aug 13, 2013 11:00 pm Post subject: Pub/Sub - Pub set new MsgId |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
Hi,
I understand that publishing to a topic sets a new MQMD.MsgId and that it is required to achieve decoupling from publisher and subscribers.
I just want to check if there is a way to disable resetting MsgId so subscriber message will have the same MsgId value?
If this is a stupid question sorry for that  |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Aug 14, 2013 2:17 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
why would you want 2/more messages in MQ to have same MsgId ?
What exactly is the requirement ?
MsgId * should * (highly recommended) be unique for a message in the MQ network for a message |
|
Back to top |
|
 |
Bartez75 |
Posted: Wed Aug 14, 2013 2:25 am Post subject: |
|
|
 Voyager
Joined: 26 Oct 2006 Posts: 80 Location: Poland, Wroclaw
|
The requirement is to send 1 msg. Publish it. Subscribers will receive it and then they will response with CorrelId = MsgId.
And yes, my feeling was that it is not a good idea but just want to check with you.
The sending app has to correlate responses on on the data level probably. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Aug 14, 2013 3:48 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Its not a stupid question. Its been brought up many times before because "Use Pub/Sub" has been a common answer to people's question of how can I make a copy of a message so I have one to the receiving app and another copy to a log queue of some sort. Pub/Sub will do it, but the main thing everyone picks up on is that the copies are not perfect copies - they have unique Message IDs.
I think there might be an open Request For Enhancement that you can vote for on IBM's site. The RFE is for having an option to ask for the Message ID to be persisted between the Publisher and all the Subscribers. Whether that is actually a good idea once you consider all the ramifications is debatable. It could cause mopre problems that it solves. But having the option to do it anyway would be nice if it was used appropriately. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
zbyszanna |
Posted: Tue Sep 26, 2017 8:21 am Post subject: |
|
|
Novice
Joined: 03 Feb 2012 Posts: 23
|
Sorry for digging up such an old topic, but has anything change in this regard? |
|
Back to top |
|
 |
JosephGramig |
Posted: Tue Sep 26, 2017 10:54 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
The point of Pub/Sub is that the publisher and subscribers know nothing (substantially) about each other. Of course they have to know what is being published to interpret/create that data. So only datagram message types apply to pub/sub.
Having said that, did you look up the answer to your question in the KC? It would be a property of a topic.
Last edited by JosephGramig on Tue Sep 26, 2017 11:42 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 26, 2017 11:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
A number of things have change including the possibility to now assign a message id / correlation id as properties on the message and have those properties in the pub / sub.
So if using the PUB/SUB model, msgId and correlId should be properties of the message and not members of the MQMD.
That makes for a litte difference in how you write the server. Also what you call the msgid and correlid should be slightly different than the name on the MQMD just to make sure there is no confusion... I'd suggest usrmsgid and usrcorrelid.
You also need to determine the value before sending the message. Using a message with immediate expiry that gets sent ... nowhere could solve the problem of getting unique values...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Sep 26, 2017 11:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The other big question is...
What does it mean to "reply" to a published message? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 26, 2017 12:39 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
The other big question is...
What does it mean to "reply" to a published message? |
And how many of those "replies" should you expect?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Sep 26, 2017 3:35 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Reply on a different topic ??
QoS is questionable. _________________ Glenn |
|
Back to top |
|
 |
zpat |
Posted: Tue Sep 26, 2017 11:21 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Sometimes the MQMD msgid or correlid fields are used (rightly or wrongly) to carry a particular value that has meaning to the receiving application.
This is why an option to preserve it would be useful when duplicating the messages (for example to update a second test system).
I think I opened the RFE under a previous IBM id, I can't remember what the IBM response was (probably "consider for a future release"). _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
zbyszanna |
Posted: Wed Sep 27, 2017 2:22 am Post subject: |
|
|
Novice
Joined: 03 Feb 2012 Posts: 23
|
PeterPotkay provided an excellent example of why this could be useful. This is exactly a scenario we are having. We have an existing queue setup and message flow and we want to duplicate this message flow to a different application temporarily without affecting the existing one. The simple yet elegant solution is to change the alias target to a topic and have two subs, but there is a problem with those msgids.
Questions "And how many of those "replies" should you expect?" are beyond the scope of the original matter. It's something which solution based on WMQ should concern itself with and not the WMQ.
Basically this problem stems from the WMQ convention, where you are supposed to copy MSGID from a request to the CORRID, and not just make the requester provide the CORRID in the first place (like it's on the Active MQ for example), but it's a subject for another discussion. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 27, 2017 4:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Actually, there are several different ways to match request/reply in MQ, based on what the request MQMD has in the Report field.
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.ref.dev.doc/q097680_.htm
MsgID -> CorrelID is the most widely used, though.
And, ok. If you want to pass the same messages to two applications, that's what pub/sub is for. But you would then have to do qalias->topic trick and use an admin subscription for the reply message as well, or know for sure that the requester can handle duplicate messages. (or doesn't care which applicatio it gets messages from) _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
zbyszanna |
Posted: Wed Sep 27, 2017 4:34 am Post subject: |
|
|
Novice
Joined: 03 Feb 2012 Posts: 23
|
I don't see why we would have to use admin subs for the reply message. Could you please elaborate? How would it solve our problem?
Multiple replies are not a problem for us, as only one application will reply. The problem for us is that the msgid of the message passed to the topic is different than the one that ends up on the server queue via subscription. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Sep 27, 2017 3:58 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
zbyszanna wrote: |
Multiple replies are not a problem for us, as only one application will reply. |
Can that be guaranteed if there are multiple subscribers to the original request?
Quote: |
The problem for us is that the msgid of the message passed to the topic is different than the one that ends up on the server queue via subscription. |
There are other methods of correlating a request message with a reply message. Use one of those methods. _________________ Glenn |
|
Back to top |
|
 |
|