Reputation: 25
I use java application with IBM mq websphere. When i am killing the application in mq is remained some information about channels. I don't know way to correct stopping of application.
Simply put, i need kill application with mq channels. Because when i restart application, it can't start and throw exception:
ERROR Failed to initialize Queue Channel.
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'TL4UZ8T' with connection mode '1' and host name 'mq4u-TL4UZ8T.lb.com(64424)'.
Thanks for helping!
Upvotes: 1
Views: 1662
Reputation: 31832
To expand on Shashi's excellent answer, there are lots of things you can consider here. For example:
MODE(INACTIVE)
so the app can reconnect.HBINT
, SHARECONV
, KEEPALIVE
and other parameters so that the channel has lots of spare instances and that the orphaned instances shut down in a timely fashion. This may include bumping up the listener backlog as well.SIGHUP
or other system signal to shut itself down gracefully.As Shashi notes, the best option is that the application communicates it's desire to shut down to the QMgr and the two cooperate to accomplish that task. The app is built to cooperate with MQ on every other task, so why not this one?
However, if that isn't an option use the instrumentation built into MQ to accomplish as close as possible to the desired result.
Failing that, use the instrumentation built into the OS but tune MQ to minimize the impact.
Upvotes: 1
Reputation: 15263
Boy! why you have to kill application? Do you mean abnormal termination of application?
The application must call Disconnect() to inform the queue manager to do clean up it's end. It's a best practice, please read other best practices here. If Disconnect is not called, queue manager does not immediately clean up resources allocated for a client connection.
So check your application code and ensure it has code to close any queues/topics/connections opened.
Upvotes: 1