ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » using MQC.MQRO_COA for put acknowledgement

Post new topic  Reply to topic
 using MQC.MQRO_COA for put acknowledgement « View previous topic :: View next topic » 
Author Message
alfia_786
PostPosted: Thu Nov 15, 2007 1:18 pm    Post subject: using MQC.MQRO_COA for put acknowledgement Reply with quote

Novice

Joined: 13 Nov 2007
Posts: 12

I found this online
http://gurubits.wordpress.com/2007/05/30/acknowledgement-messages-in-ibm-mq-series-websphere-mq/

which tells a way to get an acknowledgement after put and also i found this code on the forum which uses msg.report = MQC.MQRO_COA;

http://scratch.mqseries.net/phpBB2/viewtopic.php?p=91661&highlight=&sid=e1578142c88319b16117d98b19f13375

do you think this is the right way
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 15, 2007 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Nov 15, 2007 3:20 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I stand by the comments made here:

http://www.mqseries.net/phpBB2/viewtopic.php?p=197865&highlight=#197865

This kind of acknowledge model is a pain and nearly always unnecessary. WMQ's assured delivery separates it from less reliable, handshaking protocols.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
alfia_786
PostPosted: Thu Nov 15, 2007 3:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Thu Nov 15, 2007 4:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Vitor
PostPosted: Fri Nov 16, 2007 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Fri Nov 16, 2007 8:18 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 16, 2007 8:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » using MQC.MQRO_COA for put acknowledgement
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.