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 » General IBM MQ Support » JMS application send message to MQ problem:reason 2009

Post new topic  Reply to topic
 JMS application send message to MQ problem:reason 2009 « View previous topic :: View next topic » 
Author Message
terry902
PostPosted: Wed Jul 15, 2015 12:26 am    Post subject: JMS application send message to MQ problem:reason 2009 Reply with quote

Novice

Joined: 10 Oct 2014
Posts: 15

...
MQQueueConnection connection = (MQQueueConnection)mcf.createQueueConnection(mqUsername,mqPassword);
connection.start();

...
queueSession = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queue = queueSession.createQueue(MQClientContext.OUTBOUND_QUEUE);
queueSender = (MQQueueSender) queueSession.createSender(queue);
...
queueSender.send(Message, DeliveryMode.PERSISTENT, 3, 0);
...

-----------------------------------------------------------------------------
Sometimes 2009(MQRC_CONNECTION_BROKEN) exception occurs when execute the line queueSender.send(...) because of the network.
My question is: I want to resend message in my appliction when the network is not good, I try to Re-initialize queueSession,queue,queueSender only, but not the connection. Is that enough? Or I must Re-initialize the connection too?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 15, 2015 4:19 am    Post subject: Re: JMS application send message to MQ problem:reason 2009 Reply with quote

Grand High Poobah

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

terry902 wrote:
My question is: I want to resend message in my appliction when the network is not good, I try to Re-initialize queueSession,queue,queueSender only, but not the connection. Is that enough? Or I must Re-initialize the connection too?


If the connection's broken, it's broken, you need to reestablish it.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 15, 2015 5:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Before trying to reestablish the connection, try to close it. You may well get hit by an exception there. But if the network is good again it might just free the resource.
Regardless your resource is in no valid state to continue working with it... so the close is just a way to attempt to release it correctly...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
terry902
PostPosted: Thu Jul 16, 2015 1:03 am    Post subject: Reply with quote

Novice

Joined: 10 Oct 2014
Posts: 15

In my test, I did not reestablish the connection. After more than 4 hours, the application re-sent the message successfully. So I confused now.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jul 16, 2015 4:52 am    Post subject: Reply with quote

Grand High Poobah

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

terry902 wrote:
After more than 4 hours, the application re-sent the message successfully.


After more than 4 hours, the default connection timeout will have expired and the application will reestablish the connection by itself.

Our answers were predicated on the assumption that when you said "resend the message", you meant "resend the message at or about the same time I originally wanted to send it".

If you're prepared to wait for the various network and system components to time out, then no you don't need to reinitialize the connection. Eventually the stack will do it for you. Eventually.

Most of us have more affirmative SLAs than that, hence the advice.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » General IBM MQ Support » JMS application send message to MQ problem:reason 2009
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.