Author |
Message
|
thimerion |
Posted: Wed May 09, 2007 8:43 am Post subject: coa (confirmation on arrival) in java |
|
|
Acolyte
Joined: 08 May 2007 Posts: 67 Location: Belgium
|
Hi,
1*/ if you request a coa message, for a message send to a remote def queue, will it indicate it got to the remote def queue, to the transmission queue or to the local queue?
2*/ Anyone has an example java program that requests a coa message?
Tim |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 09, 2007 10:25 am Post subject: Re: coa (confirmation on arrival) in java |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
thimerion wrote: |
1*/ if you request a coa message, for a message send to a remote def queue, will it indicate it got to the remote def queue, to the transmission queue or to the local queue? |
COA is sent (subject to restrictions) when the message arrives on the target queue, i.e. on the remote queue manager if I have your architecture straight. Please see the Application Programmiing Reference for a full description.
Note that you may wish to consider COD messages, as this would ensure the intended application has processed before the next sequential message is sent (again if I have your requirtements straight).
thimerion wrote: |
2*/ Anyone has an example java program that requests a coa message?
|
Not a Java person!
Have you tried the sample code? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed May 09, 2007 10:46 am Post subject: Re: coa (confirmation on arrival) in java |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
thimerion wrote: |
1*/ if you request a coa message, for a message send to a remote def queue, will it indicate it got to the remote def queue, to the transmission queue or to the local queue?
|
Local queue.
thimerion wrote: |
2*/ Anyone has an example java program that requests a coa message?
Tim |
Code: |
...
MQMessage mqmessage=new MQMessage();
mqmessage.report=MQC.MQRO_ACTIVITY|MQC.MQRO_EXPIRATION|MQC.MQRO_COA|MQC.MQRO_COD|...;
mqmessage.replyToQueueName="LOCALQUEUE"; //name of queue where report will be placed
... |
_________________ Marcin |
|
Back to top |
|
 |
thimerion |
Posted: Sun May 13, 2007 2:20 am Post subject: Re: coa (confirmation on arrival) in java |
|
|
Acolyte
Joined: 08 May 2007 Posts: 67 Location: Belgium
|
marcin.kasinski wrote: |
thimerion wrote: |
1*/ if you request a coa message, for a message send to a remote def queue, will it indicate it got to the remote def queue, to the transmission queue or to the local queue?
|
Local queue.
thimerion wrote: |
message is put on a remote def queue QUEUE1, transmission queue TRANS1, to another queue manager QM2, again on a remote def queue QUEUE2, transmission queue TRANS2, to another queue manager QM3, there it is put on a local queue.
Will it then also send a coa when it gets to the local queue? Even if it goes over 3 Queue managers? And the cod when someone takes it from the very local queue on qm3?
2*/ Anyone has an example java program that requests a coa message?
Tim |
Code: |
...
MQMessage mqmessage=new MQMessage();
mqmessage.report=MQC.MQRO_ACTIVITY|MQC.MQRO_EXPIRATION|MQC.MQRO_COA|MQC.MQRO_COD|...;
mqmessage.replyToQueueName="LOCALQUEUE"; //name of queue where report will be placed
... |
|
|
|
Back to top |
|
 |
marcin.kasinski |
Posted: Sun May 13, 2007 2:55 am Post subject: Re: coa (confirmation on arrival) in java |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
thimerion wrote: |
message is put on a remote def queue QUEUE1, transmission queue TRANS1, to another queue manager QM2, again on a remote def queue QUEUE2, transmission queue TRANS2, to another queue manager QM3, there it is put on a local queue.
Will it then also send a coa when it gets to the local queue? Even if it goes over 3 Queue managers? And the cod when someone takes it from the very local queue on qm3?
|
Have you tested it ?
Do you have any problems ? _________________ Marcin |
|
Back to top |
|
 |
Vitor |
Posted: Sun May 13, 2007 6:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
On a more abstract point, the "will I get a confirmation message if..." class of questions is why confirmation messages tend not to be used. It's very easy to get into the infinite loop of message, confirmation of receipt of message, confirmation of receipt of confirmation of receipt of message and so forth.
Simply put, what does your design do if the message arrives but the receipt does not? You've doubled the size of your non-receipt processing. It's much better to architect a solution which leverages the assured delivery of MQ, then monitor the solution to ensure it works. Not only is the code more robust, you get the full value out of the MQ license fee.
My 2 cents, other views may be equally valid.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zx7R |
Posted: Sun May 13, 2007 8:24 am Post subject: hi - i have a question :) |
|
|
Novice
Joined: 08 May 2007 Posts: 12
|
l_oRequestMessage.Report = MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID + MQC.MQRO_COA;
this is in C# - > does MQC.MQRO_COA means positive acknowledge for recieving message on queue?
Thank you. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Sun May 13, 2007 8:30 am Post subject: Re: hi - i have a question :) |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
zx7R wrote: |
does MQC.MQRO_COA means positive acknowledge for recieving message on queue?
Thank you. |
From docs
Quote: |
MQRO_COA
This type of report is generated by the queue manager that owns the destination queue when the message is placed on the destination queue |
_________________ Marcin |
|
Back to top |
|
 |
Vitor |
Posted: Sun May 13, 2007 8:52 am Post subject: Re: hi - i have a question :) |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
zx7R wrote: |
this is in C# - > does MQC.MQRO_COA means positive acknowledge for recieving message on queue?
|
No, it means it's arrived at its final destination, not that's it's arrived at the queue you're putting it to. Positive acknowledgement that MQ has accepted for delivery is provided by the cc/rc pair.
It's not a good idea to use COA/COD messages for acknowledgement. If you're worried the message will not reach it's destination for some reason, what will you do if the message arrives but the acknowledgement (which is only a special kind of message) does not arrive back at the sender? If your message route is perceived as unreliable one way, logically it's unreliable the other.....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Michael Dag |
Posted: Sun May 13, 2007 12:42 pm Post subject: Re: hi - i have a question :) |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Vitor wrote: |
zx7R wrote: |
this is in C# - > does MQC.MQRO_COA means positive acknowledge for recieving message on queue?
|
No, it means it's arrived at its final destination, not that's it's arrived at the queue you're putting it to. Positive acknowledgement that MQ has accepted for delivery is provided by the cc/rc pair.
It's not a good idea to use COA/COD messages for acknowledgement. If you're worried the message will not reach it's destination for some reason, what will you do if the message arrives but the acknowledgement (which is only a special kind of message) does not arrive back at the sender? If your message route is perceived as unreliable one way, logically it's unreliable the other.....  |
Well I have heard words from a very renouned expert once (I believe it was Peter Rhys Jenkins) who mentioned instead of using persistent messages, just to use non-persistent and implement a simple ack mechanism of the messages all the time, when an ack is missing after a certain period it was easier to check just the few exceptions, rather then imposing the 'delays' of persistent messaging on all messages...
I never found out the details of that technique and where he used it...  _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun May 13, 2007 12:48 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There is a school of MQ app design that goes down that road. It usually includes a message archive/replay system as well.
One design point to consider, though, is whether the receipt/processing of acks is mostly asynchronous with the sending of "real" messages. It's easier and probably faster to send a persistent message than it is to send an np message, and then synchronously wait for the ack/report and then send the next np message.
In all cases, a message archive/reply system is an excellent thing to have in an enterprise. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Michael Dag |
Posted: Sun May 13, 2007 12:55 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
jefflowrey wrote: |
In all cases, a message archive/reply system is an excellent thing to have in an enterprise. |
I couldn't agree more... but all apps want this to be in the "infrastructure" as most app programmers don't care or don't know... _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
Vitor |
Posted: Sun May 13, 2007 1:22 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Michael Dag wrote: |
jefflowrey wrote: |
In all cases, a message archive/reply system is an excellent thing to have in an enterprise. |
I couldn't agree more... but all apps want this to be in the "infrastructure" as most app programmers don't care or don't know... |
My current site takes an archive of messages as they pass through MB. Also useful in eliminating the need for ack messages, as it enables us to prove the message was delivered!
Taking the other point, my personal view is that it's better to have 1 "slow" persistent messge than 2 "fast" non-persistent ones, which may have a longer overall response time. It's also easy to architect, design & explain to management.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
thimerion |
Posted: Tue May 22, 2007 6:17 am Post subject: Re: coa (confirmation on arrival) in java |
|
|
Acolyte
Joined: 08 May 2007 Posts: 67 Location: Belgium
|
marcin.kasinski wrote: |
thimerion wrote: |
message is put on a remote def queue QUEUE1, transmission queue TRANS1, to another queue manager QM2, again on a remote def queue QUEUE2, transmission queue TRANS2, to another queue manager QM3, there it is put on a local queue.
Will it then also send a coa when it gets to the local queue? Even if it goes over 3 Queue managers? And the cod when someone takes it from the very local queue on qm3?
|
Have you tested it ?
Do you have any problems ? |
Hi, I tried to request a COA on these situation, and it puts the COA on the dead queue of QM3, because it is destinated for QM1 ... How can I get the COA to QM1? |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Tue May 22, 2007 6:28 am Post subject: Re: coa (confirmation on arrival) in java |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
thimerion wrote: |
marcin.kasinski wrote: |
thimerion wrote: |
message is put on a remote def queue QUEUE1, transmission queue TRANS1, to another queue manager QM2, again on a remote def queue QUEUE2, transmission queue TRANS2, to another queue manager QM3, there it is put on a local queue.
Will it then also send a coa when it gets to the local queue? Even if it goes over 3 Queue managers? And the cod when someone takes it from the very local queue on qm3?
|
Have you tested it ?
Do you have any problems ? |
Hi, I tried to request a COA on these situation, and it puts the COA on the dead queue of QM3, because it is destinated for QM1 ... How can I get the COA to QM1? |
QM3 doesn't know how to send message to QM1,
You have to define on QM3 alias which tell qmgr that message to QM1 should be send to QM2.
Next on QM2 there is dirrect link to QM1 sa message will be send from QM2 to QM1. _________________ Marcin |
|
Back to top |
|
 |
|