Author |
Message
|
alfia_786 |
Posted: Thu Nov 15, 2007 1:18 pm Post subject: using MQC.MQRO_COA for put acknowledgement |
|
|
Novice
Joined: 13 Nov 2007 Posts: 12
|
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Nov 15, 2007 1:29 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The COA will tell you when the message has ARRIVED at it's destination.
This is not the same thing as an acknowledgement that the message has been PUT. And could occur at a very different time interval than you expect.
You should make sure that you have an absolute business requirement for needing this acknowledgment.
MQ is a reliable transport. If the put operation doesn't throw an exception, then MQ has the message. MQ will not then LOSE the message, unless you have told MQ that it is okay to do so and even then only under some kinds of circumstances. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 15, 2007 3:20 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
|
Back to top |
|
 |
alfia_786 |
Posted: Thu Nov 15, 2007 3:26 pm Post subject: |
|
|
Novice
Joined: 13 Nov 2007 Posts: 12
|
I just need to know that the message has arrived the destination queue,though i knw that MQ is reliable
what do you mean when you say
The COA will tell you when the message has ARRIVED at it's destination.
This is not the same thing as an acknowledgement that the message has been PUT. And could occur at a very different time interval than you expect.
can you please explain
i used this code which seems like its working:
MQMessage regrenewal = new MQMessage();
regrenewal.report = MQC.MQRO_COA;
regrenewal.writeString(data);
sendQueue.put(regrenewal, pmo);
//now get the correl id
byte [] correlId = regrenewal.messageId;
StringBuffer sb = new StringBuffer();
for(int i=0;i<correlId.length;i++){
sb.append((char)correlId[i]);
}
out.println("Correl ID="+sb);
out.println("Message sent...");
sendQueue.close();
//create new MQMessage obj to receive in reply
MQMessage replyMessage = new MQMessage();
int openOptions2 = MQC.MQOO_INQUIRE;
openOptions2 |= MQC.MQOO_INPUT_AS_Q_DEF;
MQQueue replyQueue =
qMgr.accessQueue(replyqname,openOptions2,null,null,null);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
gmo.options = MQC.MQGMO_WAIT;
gmo.waitInterval = 200;//max time to wait for bailing
replyMessage.correlationId = correlId;
out.println("About to try to get reply message, depth is "+replyQueue.getCurrentDepth());
replyQueue.get(replyMessage,gmo);
out.println("Put message to MQ and got suitable Reply message "); |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Nov 15, 2007 4:20 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Are you putting to a local queue or a remote queue? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 16, 2007 1:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alfia_786 wrote: |
I just need to know that the message has arrived the destination queue,though i knw that MQ is reliable |
Again I ask why? What requirement are you trying to fulfil? More importantly, what do you plan to do (in processing terms) if the acknowldgement doesn't turn up? Send the message again? Send a compensating transaction? What?
A COA report will be generated when the message arrives at the destination queue, and is therefore mostly redundant because you know that as soon as the PUT returns a RC/CC 0. A COD report will be generated when the message is read off the target queue by the receiving application but again I was what do you plan to do if the report doesn't turn up?
A little more on your requirement may help us indicate a better solution. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Nov 16, 2007 8:18 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
The big problem with COAs and CODs across a network is you can never be 100% sure what happened when you don't get the COA / COD.
Did the request message never make it?
Or did the request message make it but a problem with the return path is preventing the COA / COD from getting to you? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 16, 2007 8:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Or has the request message just not gotten there yet... because the network is down and the message is on the transmit queue... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|