ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexGeneral IBM MQ SupportPub/Sub - Pub set new MsgId

Post new topicReply to topic Goto page 1, 2  Next
Pub/Sub - Pub set new MsgId View previous topic :: View next topic
Author Message
Bartez75
PostPosted: Tue Aug 13, 2013 11:00 pm Post subject: Pub/Sub - Pub set new MsgId Reply with quote

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
View user's profile Send private message
AkankshA
PostPosted: Wed Aug 14, 2013 2:17 am Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Bartez75
PostPosted: Wed Aug 14, 2013 2:25 am Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Wed Aug 14, 2013 3:48 am Post subject: Reply with quote

Jedi Council

Joined: 15 May 2001
Posts: 7377

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
View user's profile Send private message
zbyszanna
PostPosted: Tue Sep 26, 2017 8:21 am Post subject: Reply with quote

Novice

Joined: 03 Feb 2012
Posts: 21

Sorry for digging up such an old topic, but has anything change in this regard?
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Tue Sep 26, 2017 10:54 am Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1180
Location: Derby City, 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
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Tue Sep 26, 2017 11:35 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19382
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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Sep 26, 2017 11:44 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

The other big question is...

What does it mean to "reply" to a published message?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Sep 26, 2017 12:39 pm Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19382
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
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Tue Sep 26, 2017 3:35 pm Post subject: Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1732
Location: Melbourne, Australia

Reply on a different topic ??
QoS is questionable.
_________________
Glenn
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Sep 26, 2017 11:21 pm Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5559
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
View user's profile Send private message
zbyszanna
PostPosted: Wed Sep 27, 2017 2:22 am Post subject: Reply with quote

Novice

Joined: 03 Feb 2012
Posts: 21

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
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 27, 2017 4:08 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

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
View user's profile Send private message
zbyszanna
PostPosted: Wed Sep 27, 2017 4:34 am Post subject: Reply with quote

Novice

Joined: 03 Feb 2012
Posts: 21

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
View user's profile Send private message
gbaddeley
PostPosted: Wed Sep 27, 2017 3:58 pm Post subject: Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1732
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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexGeneral IBM MQ SupportPub/Sub - Pub set new MsgId
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.