Author |
Message
|
ktg |
Posted: Fri Dec 17, 2010 4:14 am Post subject: How to get original message id of publication? |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Hi All,
Is it possible to get message id/correlation id set in the publisher application by subscriber application. If yes, could please provide links to get more information.
Thanks in advance,
Kalpana |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 4:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What happens when you try it? |
|
Back to top |
|
 |
ktg |
Posted: Fri Dec 17, 2010 4:25 am Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Message id and correlation id of message received by subcriber application is not same as that of the message id/correlation id set by the publisher application.
For ex., publisher has set message id as XYZ and correlation id has not set.
The subscriber is receiving message with ABC as message id and PQR as correlation id.
I could not find any document which explains relationship between message id/correlation id in published/subscribed message . |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 4:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So, given that Pub/Sub is One To Many, do you really want every subscription message to have the SAME message id?
What requirement are you trying to fulfill by having the messageId set by the publisher? |
|
Back to top |
|
 |
ktg |
Posted: Fri Dec 17, 2010 4:45 am Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
No I dont want every subscription message to have the SAME message id.
There is system A which sends "exchange rates" message. Application B and C would need exchange rate information.
So there is a message flow which takes A's message and publishes it in CDM format. There is another flow which takes CDM exchange rate message and puts in to B's queue. One more flow to take CDM exchange rate message and put it in to C's queue.
For auditing/debugging we need to relate messages/correlation ids in these flows:
A to CDM and CDM to B
A to CDM and CDM to C |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 4:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Okay, so you just want an audit trail.
Using msgid/correlId for this is not a bad thought, but as you have found it may not apply very well in a pub/sub domain.
You'll have to look for something else. You CAN, if you specify the Put options right options, have the publisher forward the correlationID to all subscription messages. But only if you have a pub-sub hierarchy, not a collective. |
|
Back to top |
|
 |
ktg |
Posted: Sun Dec 19, 2010 9:29 pm Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
I checked the MQPMO options and I tried setting correlation id in publication message and without setting "MQPMO_NEW_CORREL_ID". But, still the correlation id is not getting passed to subscriptions Am I missing some thing? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Dec 19, 2010 9:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ktg wrote: |
I checked the MQPMO options and I tried setting correlation id in publication message and without setting "MQPMO_NEW_CORREL_ID". But, still the correlation id is not getting passed to subscriptions Am I missing some thing? |
I hope your subscription is not setup by correlationId (default?).
What you can get is a confirmation that the publication was successful. This confirmation should then be sufficient as you trust MQ to forward the published message to all subscribers.
If you really need to track things you can have the publisher add a property in the usr folder of the RFH2 and verify it at the subscriber level.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ktg |
Posted: Sun Dec 19, 2010 10:06 pm Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Yes my subscription is not set up for a particular correlation id.
I will discuss the option of using a property in usr folder with my manager. Thanks for the suggestion.
-Kalpana |
|
Back to top |
|
 |
|