繁体   English   中英

无法使用 pymqi 连接到 IBM MQ

[英]Unable to connect to IBM MQ using 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"
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_CHANNEL_CONFIG_ERROR)错误是您尝试连接到队列管理器上非SVRCONN类型的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 特定问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM