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 » Gracefully stopping Java MQ app

Post new topic  Reply to topic
 Gracefully stopping Java MQ app « View previous topic :: View next topic » 
Author Message
DeadHead
PostPosted: Tue Jan 09, 2007 6:59 am    Post subject: Gracefully stopping Java MQ app Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12

'Lo all,
I have a Java app running on an iSeries or AS400 that reads from a MQ queue and writes to an iSeries dataQ. Works fine, question is, how can I bring it down "gracefully" or cleanly? Any ideas or comments would be appreciated... Thanks.
_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Jan 09, 2007 7:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Code it to quit when the queue is empty, or code it to accept a special shutdown message. Search here for Feedback codes.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DeadHead
PostPosted: Tue Jan 09, 2007 8:05 am    Post subject: Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12

jefflowrey wrote:
Code it to quit when the queue is empty, or code it to accept a special shutdown message. Search here for Feedback codes.


Do you mean to just send a "special" message through the MQ queue and check for it. When it is read, then close and disconnect? Thanks...
_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Jan 09, 2007 8:08 am    Post subject: Reply with quote

Grand High Poobah

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

DeadHead wrote:
Do you mean to just send a "special" message through the MQ queue and check for it. When it is read, then close and disconnect? Thanks...


Exactly so. It is one of the traditional methods.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
DeadHead
PostPosted: Tue Jan 09, 2007 8:12 am    Post subject: Thanks jefflowrey & Vitor for you time & help... Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12


_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Tue Jan 09, 2007 10:20 am    Post subject: Re: Gracefully stopping Java MQ app Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

DeadHead wrote:
I have a Java app running on an iSeries or AS400 that reads from a MQ queue and writes to an iSeries dataQ. Works fine, question is, how can I bring it down "gracefully" or cleanly?

Go read my comments in this posting.
http://www.mqseries.net/phpBB2/viewtopic.php?t=33075

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
DeadHead
PostPosted: Tue Jan 09, 2007 12:03 pm    Post subject: Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12

Thank you Roger. Thanks to all of you...

PS You need some "new" Emoticons with an "attitude"....
_________________
"One man gathers what another man spills" GD
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Jan 09, 2007 12:05 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jsware
PostPosted: Wed Jan 10, 2007 5:21 am    Post subject: Re: Gracefully stopping Java MQ app Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

RogerLacroix wrote:
Go read my comments in this posting.
http://www.mqseries.net/phpBB2/viewtopic.php?t=33075
RogerLacroix (on the other thread) wrote:
MQ Best Practice for terminating a Get Wait Forever.

A thread / program / whatever, puts an empty message on the queue with the MQMD's Feedback set to MQFB_QUIT.

Then in your child thread that reads the queue, you put the following:
Code:
if (msg.feedback == MQC.MQFB_QUIT)
{
   return;
   // or throw an exception - no message or time to quit ...
}

Hey I learn't somthing today. A bit later than jeff did (see the other thread)

Thanks for the tip Roger. I'm off to incorporate this snip of code into my adapter layer...
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
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 » Gracefully stopping Java MQ app
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.