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 API Support » Not able to backout messages when not committing

Post new topic  Reply to topic
 Not able to backout messages when not committing « View previous topic :: View next topic » 
Author Message
phanideepm
PostPosted: Mon Nov 05, 2007 10:43 pm    Post subject: Not able to backout messages when not committing Reply with quote

Newbie

Joined: 05 Nov 2007
Posts: 4

Hi all, my requirement is to backout the msg in to queue during application abnormal termination or when commit call is not made. i am using mq java api where i am setting MQC.MQGMO_SYNCPOINT option on MQGetMessageOptions obj and issuing get call on mqqueue obj . please let me know if any thing else is need to set when process happens in local unit of work. please help me...
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Nov 05, 2007 11:22 pm    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Check the usage notes in the APR, MQDISC, for whayt happens when an app ends, normally or abnormally, without calling MQCMIT or MQBACK.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
phanideepm
PostPosted: Mon Nov 05, 2007 11:27 pm    Post subject: Reply with quote

Newbie

Joined: 05 Nov 2007
Posts: 4

according usage notes msg ill be backedout incase of abnormal termination but that is not happening. my doubt is whether i need to set any thing else apart from syncpoint option on get msg options..
thanks for the reply
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 06, 2007 1:03 am    Post subject: Reply with quote

Grand High Poobah

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

Are you saying that the message remains consumed or that it's not on the backout queue specified for the queue it was read from?

If the latter, then remember that the queue manager doesn't honour this setting, only records it. Some app servers (I notice you're using Java) do honour it as part of the JMS service. If you are in such a configuration, check the backout settings on the original queue.

If the former, make sure the message really is under a syncpoint.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
phanideepm
PostPosted: Tue Nov 06, 2007 1:29 am    Post subject: Reply with quote

Newbie

Joined: 05 Nov 2007
Posts: 4

Yes, the message remains consumed. Did the following to check if the queue manager is under sync point -

System.out.println("resQueueManager.getSyncpointAvailability() : " + resQueueManager.getSyncpointAvailability());

The result is 1 (MQC.MQSP_AVAILABLE). Anything else needs to be checked ?

Pls find the code below to read the message with sync point option set

MQMessage msg = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.waitInterval = TIMEOUT;
gmo.options = MQC.MQGMO_SYNCPOINT + MQC.MQGMO_WAIT + MQC.MQGMO_VERSION_2;
resQueue.get(msg, gmo);
byte[] readArr = new byte[msg.getDataLength()];
msg.readFully(readArr);
textMsg = new String(readArr);
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 06, 2007 3:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There are different behaviors in different languages for default behavior of rollback/commit during abnormal termination. You may, for example, need to explicitly issue a rollback().
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
phanideepm
PostPosted: Wed Nov 07, 2007 2:06 am    Post subject: Reply with quote

Newbie

Joined: 05 Nov 2007
Posts: 4

i am issuing rollback in the shutdown hook but i didnt get positive results
Back to top
View user's profile Send private message
bower5932
PostPosted: Wed Nov 07, 2007 5:20 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You could take a look at backout.java at:

http://www-304.ibm.com/jct09002c/isv/tech/sampmq.html

It gets a message a number of times and backs it out until the backout threshold is reached.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Not able to backout messages when not committing
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.