Author |
Message
|
koushikt |
Posted: Tue Feb 03, 2015 1:10 pm Post subject: Monitoring for COD or COA |
|
|
Novice
Joined: 26 Jan 2015 Posts: 14
|
I am writing a new publisher which is going to need a confirmation on arrival/delivery of the message. I have the option set up and I also have set the ReplyToQ.
How do I monitor for these Reports? Do I need to have a separate thread which is actively listening on this queue?
Another thing I found is, if I don't have a COD_WITH_DATA all I get is a blank message to the queue when a message is delivered. So, I have no Idea to figure which message got missed/delivered with this.
Am I missing something? |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Feb 03, 2015 1:16 pm Post subject: Re: Monitoring for COD or COA |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
koushikt wrote: |
I am writing a new publisher which is going to need a confirmation on arrival/delivery of the message. I have the option set up and I also have set the ReplyToQ.
How do I monitor for these Reports? Do I need to have a separate thread which is actively listening on this queue? |
COA and COD are report options specified in the MQMD of the request message. Your app needs to MQGET the COA and COD report messages from the reply-to-queue.
koushikt wrote: |
Another thing I found is, if I don't have a COD_WITH_DATA all I get is a blank message to the queue when a message is delivered. So, I have no Idea to figure which message got missed/delivered with this.
Am I missing something? |
Yes, report messages, like COA and COD, will have the CorrelId that matches the MsgId of the request message. You/your app will need to match use the CorrelId field to understand which request message (MsgId) caused the COA/COD report messages to be returned to your app. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Feb 03, 2015 2:15 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Quote: |
I am writing a new publisher which is going to need a confirmation on arrival/delivery of the message. |
What is your business requirement for confirmation? In most cases, COA and COD are not worth the hassle and create extra message traffic. Trust MQ to deliver the message.
The Report message feature is rarely, as it provides no information on what the consuming app did with the message. Trust MQ to deliver the message. If a consumer app gets it, request it to generate a reply message containing something meaningful, if that is what you desire. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Feb 03, 2015 2:23 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
gbaddeley wrote: |
Quote: |
I am writing a new publisher which is going to need a confirmation on arrival/delivery of the message. |
What is your business requirement for confirmation? In most cases, COA and COD are not worth the hassle and create extra message traffic. Trust MQ to deliver the message.
The Report message feature is rarely [used], as it provides no information on what the consuming app did with the message. Trust MQ to deliver the message. If a consumer app gets it, request it to generate a reply message containing something meaningful, if that is what you desire. |
COD doesn't tell you that the intended app consumed the message - only that it was consumed by some app. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Feb 03, 2015 3:43 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
If you get the COD, you know some app picked it up. If you don't get the COD, well, maybe the original app message was delivered but the COD message was not able to make it all the way back to the reply queue.
And so where does that leave you. When you don't get a COD, you are left wondering what happened. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
koushikt |
Posted: Tue Feb 03, 2015 4:18 pm Post subject: |
|
|
Novice
Joined: 26 Jan 2015 Posts: 14
|
Ah. Okay I get it.
But anyways, I will have to implement this like a first line of defense when someone complains.
What I found was my report messages CorrelId had garbage value. Even though I set a MsgId in my MQPUT. I receive garbage for CorrelId when I do a MQGET on my ReplyToQ.
The CorrelId is garbage for my actual message queue too. Is there any setting I need to set in code for making the MsgIds and CorrelIds available for access? |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Feb 03, 2015 5:45 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Both MsgId and CorrelId fields are 24-byte fields - not character fields or numeric.
How exactly does the requesting application set MsgId at the MQPUT?
Does the replying application set the reply message CorrelId = request message MsgId?
How do you know that it's garbage? What utility are you using to look at it?
Please copy/paste the request message MsgId and reply message CorrelId here. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
koushikt |
Posted: Tue Feb 03, 2015 5:58 pm Post subject: |
|
|
Novice
Joined: 26 Jan 2015 Posts: 14
|
I was initially reading it as a string. Hence the gibberish.
After looping the array and printing an Hex this is what I find
Publisher:
MessageId: 414D5120514D5F53443920202020202054D07AF120078366
Correl: 000000000000000000000000000000000000000000000000
Sub1:(MQSUB to the Publisher)
MsgId: 414D5120514D5F53443920202020202054D07AF120078367
CorrelId: 414D5120514D5F53443920202020202054D07AF120078104
Sub2:(MQSUB to the Publisher)
MsgId: 414D5120514D5F53443920202020202054D07AF120078368
CorrelId: 414D5120514D5F53443920202020202054D07AF120076404
Queue Connected to Topic: (MQOPEN to the Connected Topic)
MsgId: 414D5120514D5F53443920202020202054D07AF12007836A
CorrelId: 414D5120514D5F53443920202020202054C9F6E4200499EC
Report On ReplyToQ:(MQOPEN to ReplyToQ)
MsgId: 414D5120514D5F53443920202020202054D07AF12007810F
CorrelId: 414D5120514D5F53443920202020202054D07AF120078367 |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Feb 03, 2015 8:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
In the pub / sub model the correlation id is traditionally used for something else. If you use a straight request reply set up (p2p) you can correlate.
However as you can see the msgid / correlation id is pretty useless when doing pub/sub.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Feb 03, 2015 9:24 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
can you explain why publishers need to know that a subscriber has received a publication? One of the principles of the pub/sub model is that publishers and subscribers are not connected - they have no explicit relationship, no knowledge of each other. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 04, 2015 5:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I remember something about an option to receive some kind of MQRC or etc. if 0 subscribers received a publication...
I don't remember the details. And I am reasonably sure it doesn't tell you how many more than 0. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Feb 04, 2015 5:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
I remember something about an option to receive some kind of MQRC or etc. if 0 subscribers received a publication...
I don't remember the details. And I am reasonably sure it doesn't tell you how many more than 0. |
There is an option to force all or nothing and get a RC for the publication.
You have however to send a request message as a publication (with replyto qmgr and replyto queue).  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|