Author |
Message
|
Holulu |
Posted: Tue Jan 05, 2010 6:57 am Post subject: COA and COD |
|
|
Newbie
Joined: 16 Oct 2009 Posts: 5
|
Hello, I have a question regarding the Confirmation of Arrival(COA) and Confirmation of Delivery(COD) messages. I have opted to received both these messages when I PUT the message as follows
mqMsg.Report = MQC.MQRO_COA + MQC.MQRO_COD
When I get the message, I do see both the COA and COD receiving in the queue. The problem is when I get the message both the messages are 0 (Zero) which is not able to differentiate the messages as follows.
retrievedMessage.Report is returning 0.
And the following code returns "COA RECEIVED" while getting both COA and COD message from the queue. Please let me know what is the error I am doing. Thanks
If retrievedMessage.Report = MQC.MQRO_COA Or MQC.MQRO_COA_WITH_FULL_DATA or MQC.MQRO_COA_WITH_DATA then
Msgbox("COA RECEIVED")
ElseIf retrievedMessage.Report = MQC.MQRO_COD or MQC.MQRO_COD_WITH_FULL_DATA or MQC.MQRO_COD_WITH_DATA Then
Msgbox("COD RECEIVED")
End If |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 05, 2010 7:40 am Post subject: Re: COA and COD |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Holulu wrote: |
Please let me know what is the error I am doing. |
Aside from using COA/COD messages, which is often a mistake. You should review some of the discussions surrounding them on this forum as they're seldom necessary and often cause problems.
Aside from that, you should examine the message (using amqsbcg or similar) and determine the field you're testing is what you think it is. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Holulu |
Posted: Tue Jan 05, 2010 7:49 am Post subject: |
|
|
Newbie
Joined: 16 Oct 2009 Posts: 5
|
Sorry, I did not follow you. Are you saying it is not a good practice to set COA and COD? My question is simple I am receiving both the COA and COD messages in the queue, only thing is I am not able to differentiate these messages while getting from the queue as both seem to be returning 0. Is there is a way to diffentiate? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 05, 2010 8:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Holulu wrote: |
Are you saying it is not a good practice to set COA and COD? |
It's not best practice, and is often not actually a good idea as a design.
Holulu wrote: |
Is there is a way to diffentiate? |
Yes, and if you'd followed my suggestion you might have found a clue. The field you're testing in the reply is the field you're setting the report options in. Unless the queue manager generating the message inexplicably wanted some reports then of course it's 0.
The information you're looking for is elsewhere. And described in the documentation. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Holulu |
Posted: Tue Jan 05, 2010 8:54 am Post subject: |
|
|
Newbie
Joined: 16 Oct 2009 Posts: 5
|
Can you be more detail oriented please for the alternate way if COA/COD are not a good pratice. Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 05, 2010 9:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Holulu wrote: |
Can you be more detail oriented please for the alternate way if COA/COD are not a good pratice. Thanks |
What alternate way? To do what? It's the concept that's flawed. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jan 05, 2010 9:11 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Please search here on COA and COD. The relative value of these has been discussed in great detail.
Birefly, COA indicates that the request message arrived in a destination queue; COD means that the message was consumed.
Neither guarantees or assures that the message arrived in the queue where it should have gone; or that the message was consumed by the application that should have consumed it. Given this, for me, COA and COD do not offer any useful information.
WMQ is a pipe through which messages flow. WMQ does not duplicate or lose messages; but it is possible that applications can.
A best-practice - good application design - has the requesting application keep track (in a DB, for example) of request messages is has sent, AND replies it has received. Likewise, the replying app should keep track of requests it has received, AND replies it has sent back. Both requesting and replying apps should be sensitive (and take appropriate action) if messages are duplicated or lost. _________________ 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 |
|
 |
bruce2359 |
Posted: Tue Jan 05, 2010 9:20 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
In response to your original post, read Chapter 7. Report options and message flags in the WMQ Application Programming Reference manual for a discussion of report messages. _________________ 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 |
|
 |
RogerLacroix |
Posted: Thu Jan 07, 2010 3:13 pm Post subject: Re: COA and COD |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Holulu wrote: |
retrievedMessage.Report is returning 0. |
Exactly.
RTM (Read The Manual).
What you need is:
Code: |
if (getMsg.feedback == MQC.MQFB_COA)
{
...
}
else if (getMsg.feedback == MQC.MQFB_COD)
{
...
} |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|