Python 无法使用pymqi连接到IBM MQ

Python 无法使用pymqi连接到IBM MQ,python,ibm-mq,pymqi,Python,Ibm Mq,Pymqi,在使用库pymqi连接到IBM MQ时,我遇到以下错误 它是一个集群MQ通道 pymqi.MQMIError: MQI Error. Comp: 2, Reason 2539: FAILED: MQRC_CHANNEL_CONFIG_ERROR 请看下面我的代码 queue_manager = "QMNAME" channel = bytes(str("CHANNEL_NAME")) host = "xx.xx.xx.xx" port = "1800" queue_name = "QN" co

在使用库pymqi连接到IBM MQ时,我遇到以下错误

它是一个集群MQ通道

pymqi.MQMIError: MQI Error. Comp: 2, Reason 2539: FAILED: MQRC_CHANNEL_CONFIG_ERROR
请看下面我的代码

queue_manager = "QMNAME"
channel = bytes(str("CHANNEL_NAME"))
host = "xx.xx.xx.xx"
port = "1800"
queue_name = "QN"
conn_info1 = bytes("%s(%s)" % (host, port))
message = b'{"alert":[{"timestamp":"Wed Jun 27 11:07:37 CDT 2018","shortDescription":"Last 24 hrs Sev 4 Volume Deviation is 84% lower than baseline","alertColor":"red","title":"Sev 4 Volume Deviation"}]}'

# Message Descriptor
put_mqmd = pymqi.MD()
qmgr = pymqi.connect(queue_manager, channel, conn_info1)
queue = pymqi.Queue(qmgr, queue_name)
在下面的行中获取错误

qmgr = pymqi.connect(queue_manager, channel, conn_info1)
原因:
2539(MQRC\u CHANNEL\u CONFIG\u ERROR)
错误是由于您试图连接到队列管理器上不属于
SVRCONN类型的通道而导致的。MQ客户端必须连接到
SVRCONN
通道

其他信息: 如果查看队列管理器错误日志,您将看到相应的
AMQ9502
错误,例如:

AMQ9502: Type of channel not suitable for action requested.

EXPLANATION:
The operation requested cannot be performed on channel 'CHANNEL_NAME'. Some
operations are only valid for certain channel types. This channel is a
'CLUSRCVR' channel type. For example, you can only ping or trigger a channel
from the initiating end.
ACTION:
Check whether the channel name is specified correctly.  If it is check that the
channel has been defined correctly.
决议: 确保在要连接到的队列管理器上定义了
SVRCONN
通道

故障排除: MQ客户机附带了一个示例程序
amqscnxc
,您可以使用它来测试您在示例中指定的参数。例如,在Linux/Unix上(在Windows上对conname的引用可能不同),请执行以下操作:

amqscnxc -x 'xx.xx.xx.xx(1800)' -c CHANNEL_NAME QMNAME

结果将是相同的
2539
错误,但这确实表明这不是pymqi特有的问题。

因此这里的CHLTYPE是CLUSRCVR,因此它将无法连接?这是正确的,
CLUSRCVR
通道的目的是允许集群中的其他队列管理器连接到它,不是MQ客户机。@yasinmohammed check out“”,以获取IBM为IBM MQ新手提供的一个很好的免费指南。感谢您提供的链接,我将查看它。