Trying to issue MQCMD_STOP_CONNECTION with MQBACF_CONNECTION_ID from MQCMD_INQUIRE_CONNECTION
Briefly summarized I'm writing a script to cleanup orphaned queue manager connections. (By default WMQ never time-outs connections and I'm not willing to change this setting at this moment, since it will impact too much applications not reconnecting automatically. Sometimes abrupt network outages or firewalls can cause stale connections on the WMQ server, which cause occupied connection resources on the queue manager).
Basically I'm calling MQCMD_INQUIRE_
Here's some simplified sample code that just closes the first connection returned by MQCMD_INQUIRE_
<code>
import pymqi
from CMQC import *
from CMQCFC import *
cd = pymqi.cd()
cd.ChannelName = 'SYSTEM.
cd.ConnectionName = 'myserver(1414)'
cd.ChannelType = MQCHT_CLNTCONN
cd.TransportType = MQXPT_TCP
qmgr = pymqi.QueueMana
qmgr.connectWit
pcf=pymqi.
# Determine connectionID of first connection
# Stopping a random connection is dangerous of course, so change it to another one if required!
connDicts=
connId=
# Now close this connection
pcf.MQCMD_
</code>
Now my concrete issues are:
1) The connDicts[
In the infocenter I read: "The value for EXTCONN is based on the first sixteen bytes of the ConnectionId converted to its 32–character hexadecimal equivalent. Connections are identified by a 24-byte connection identifier. The connection identifier comprises a prefix, which identifies the queue manager, and a suffix which identifies the connection to that queue manager. By default, the prefix is for the queue manager currently being administered, but you can specify a prefix explicitly by using the EXTCONN parameter. Use the CONN parameter to specify the suffix."
=> In practice I've observed the value returned by binascii.
2) When I issue the MQCMD_STOP_
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- PyMQI Edit question
- Assignee:
- Dariusz Suchojad Edit question
- Solved by:
- Rik Baeten
- Solved:
- Last query:
- Last reply: