Author |
Message
|
pfaulkner |
Posted: Tue May 15, 2007 10:59 am Post subject: MQ Queue Status question |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
I have a situation where I need to monitor for open MQ connections for activity and close the connection if no activity is seen on the mq queue over a period of time.
I know MQExplorer allows you to see current connections open for a queue manager and disconnect a connection to a queue.
Is there a way to determine how long a connection has been open and when it was last active? |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 15, 2007 11:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Pedantically, you don't connect to a queue, you connect to a queue manager.
You might be better off checking how many connection are associated with a no longer existent PID. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Wed May 16, 2007 12:13 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
MQ v6 has a disconnect interval option for client channels. |
|
Back to top |
|
 |
dgolding |
Posted: Wed May 16, 2007 1:31 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
if you do a
Code: |
dis chs(*) lstimsgti chstati lstmsgda chstada |
in "runmqsc" then you can get the channel start date/time and more importantly the last message date/time - if a connection is inactive then the last message date/time will be far in the past. |
|
Back to top |
|
 |
pfaulkner |
Posted: Wed May 16, 2007 8:24 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
In this case there are no channels involved. The application connects to a local qmgr and opens the queue. So we want to monitor for activity from the application for the open connection to the qmgr, in this case the application opens a single queue. So either we need to be able to capture activity at the queue level or the connection to the qmgr. |
|
Back to top |
|
 |
tleichen |
Posted: Wed May 16, 2007 11:25 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
pfaulkner wrote: |
... So either we need to be able to capture activity at the queue level or the connection to the qmgr. |
Why would you want to do this? Wouldn't adding some sort of logging by the application provide the same information?  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
pfaulkner |
Posted: Wed May 16, 2007 11:56 am Post subject: |
|
|
Master
Joined: 18 Mar 2002 Posts: 241 Location: Colorado, USA
|
Yes I am sure there are alternatives, just looking for solutions that could monitor all connections as opposed to writing solutions in each application where this is neccessary. In this case it's an RPG database triggered application that currently just opens a connection when triggered and then processes each database trigger (puts the database record to the open queue). |
|
Back to top |
|
 |
tleichen |
Posted: Wed May 16, 2007 12:26 pm Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
Not sure what your main interest is from a monitoring perspective. If your purpose is to audit the traffic to the database, then I'm sure there are already logs of that.
But, if you are trying to monitor the connections to the queue manager itself, there are several products out there that do just that. If doins so was just a simple task, those people would not be able to sell those products.  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
|