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 » new MQQueueManager (...) does not return...

Post new topic  Reply to topic
 new MQQueueManager (...) does not return... « View previous topic :: View next topic » 
Author Message
tqtuan
PostPosted: Fri Nov 21, 2003 3:23 pm    Post subject: new MQQueueManager (...) does not return... Reply with quote

Newbie

Joined: 21 Nov 2003
Posts: 2

Hi,

My application accesses the queue using MQQueueManager(...) to send messages. After awhile, MQ goes down and any attemps to send to the queue throws an exception. When the exception is thrown, I try to recreate the MQQueueManager(...) so that I can access the queue, but the statement "new MQQueueManager(...) never return". Can someone tell me why, please?

below is the code:

Code:


//set msg options
pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_SET_IDENTITY_CONTEXT;

//set up MQEnvironment
MQEnvironment.channel = channelName;
MQEnvironment.hostname = hostName;
MQEnvironment.port = port;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES);
MQEnvironment.disableTracing();

while (error){
   try {     
      //create queue manager
      MQQueueManager queueManager = new MQQueueManager(queueManagerName); //It hangs here when the loop repeats
      //access queue
      MQQueue outQueue = queueManager.accessQueue(
                                          queuename,             
                                          s_OPENQUEUEOPTIONS,
                                          null,           // default q manager
                                          null,           // no dynamic q name
                                          null);          // no alternate user id
      MQMessage mqm = new MQMessage();
      ....code to set message
      outQueue.put(mqm, pmo);
      outQueue.close();
      queueManager.disconnect();
      break;
   }
   catch (....){
      continue;
   }
}
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 » new MQQueueManager (...) does not return...
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.