Author |
Message
|
vanimireddys |
Posted: Mon Oct 18, 2010 12:03 pm Post subject: How to stop server connection channel if it is idle |
|
|
Newbie
Joined: 04 Oct 2010 Posts: 5
|
Hi,
I have a java application which connects to QueueManager and puts message in queue. After putting the message in queue I am closing the connection. After waiting for some time when no messages are available to put into queue I need to stop the server connection channel.
I have tried with PCF command to modify channel with KeepAliveInterval and HeartBeat, I am not ableto get what I am expecting.
Please help me how to stop the server connection channel, if the application is not using the channel for very long time.
Thanks in advance |
|
Back to top |
|
 |
Vitor |
Posted: Mon Oct 18, 2010 12:55 pm Post subject: Re: How to stop server connection channel if it is idle |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vanimireddys wrote: |
I have tried with PCF command to modify channel with KeepAliveInterval and HeartBeat, I am not ableto get what I am expecting. |
What are you expecting? More importantly what are you seeing that has led you to believe you need to do this? A svrconn channel should stop after a period of inactivity automatically.
Thought of course the status won't be stopped. But you knew that.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Oct 19, 2010 2:43 pm Post subject: Re: How to stop server connection channel if it is idle |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
vanimireddys wrote: |
Hi,
I have a java application which connects to QueueManager and puts message in queue. After putting the message in queue I am closing the connection. After waiting for some time when no messages are available to put into queue I need to stop the server connection channel.
I have tried with PCF command to modify channel with KeepAliveInterval and HeartBeat, I am not ableto get what I am expecting.
Please help me how to stop the server connection channel, if the application is not using the channel for very long time.
Thanks in advance |
If the channel is still running after you have finished putting messages it appears that you are not actually disconnecting correctly in your application. Make sure you are CLOSING the queue and DISCONNECTING from the queue manager. _________________ Glenn |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Oct 19, 2010 2:46 pm Post subject: Re: How to stop server connection channel if it is idle |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Vitor wrote: |
A svrconn channel should stop after a period of inactivity automatically. |
You mean the svrconn connection will be cleaned up automatically after a period if the client end has died (did not disconnect cleanly for some reason) ?
If the client end is still active (connected), a svrconn will stay running indefinitely. _________________ Glenn |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 19, 2010 4:56 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
And even if a client app has issued a specific disconnect() or otherwise disposed of a connection object, a JVM may actually keep the connection open and lying around for a while "just in case".
At least for as long as the JVM itself is alive. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Tue Oct 19, 2010 9:36 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
in addition, svrconn chzannels are sometimes shared between several applications. make sure that no other application is using this channel if you still see it "running" although you already disconnected. _________________ Regards, Butcher |
|
Back to top |
|
 |
vanimireddys |
Posted: Wed Oct 20, 2010 12:17 pm Post subject: How to stop server connection channel if it is idle |
|
|
Newbie
Joined: 04 Oct 2010 Posts: 5
|
I have standalone application that is using connection pooling implemented using commons-pool-1.3.jar. After putting the message the connection is returned to the pool. Now I got requirement to kill the entire pool if atleast one connection is not used for specific period of time.
I thought of killing the server connection channel, if no connection is used for specific time.
Please let me know options available to achive this.
Thanks in advance. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Oct 20, 2010 12:21 pm Post subject: Re: How to stop server connection channel if it is idle |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
vanimireddys wrote: |
I have standalone application that is using connection pooling implemented using commons-pool-1.3.jar. After putting the message the connection is returned to the pool. Now I got requirement to kill the entire pool if atleast one connection is not used for specific period of time.
I thought of killing the server connection channel, if no connection is used for specific time.
Please let me know options available to achive this.
Thanks in advance. |
You need to implement that at the pool level. Make sure to set min connections in pool to 0.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|