1

I am getting the below error while connecting to IBM MQ using library pymqi.

Its a clustered MQ channel

pymqi.MQMIError: MQI Error. Comp: 2, Reason 2539: FAILED: MQRC_CHANNEL_CONFIG_ERROR

Please see my code below.

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)

Getting error at the line below

qmgr = pymqi.connect(queue_manager, channel, conn_info1)
JoshMc
  • 10,239
  • 2
  • 19
  • 38
yasin mohammed
  • 461
  • 2
  • 10
  • 26

1 Answers1

2

Cause:

The 2539 (MQRC_CHANNEL_CONFIG_ERROR) error is a result of you attempting to connect to a channel on the queue manager that is not of type SVRCONN. A MQ client must connect to a SVRCONN channel.

Additional information:

If you review the queue manager error logs you would see corresponding AMQ9502 errors, for example:

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.

Resolution:

Make sure you have a SVRCONN channel defined on the queue manager you wish to connect to.

Troubleshooting:

The MQ client comes with a sample program amqscnxc, you could use this to test out the parameters you have specified in your example. For instance on Linux/Unix (quoting of the conname may be different on Windows) do the following:

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

The result would be the same 2539 error, but this does show it is not a pymqi specific problem.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
  • So over here its CHLTYPE is CLUSRCVR so it will not be able to connect ? – yasin mohammed Feb 27 '19 at 09:00
  • That is correct, a `CLUSRCVR` channel's purpose is to allow other queue managers in a cluster to connect to it, not MQ clients. – JoshMc Feb 27 '19 at 09:07
  • @yasinmohammed check out "[MQ Essentials - Getting started with IBM MQ](https://developer.ibm.com/messaging/learn-mq/mq-tutorials/getting-started-mq/)" for a nice free guide IBM has provided for those new to IBM MQ. – JoshMc Feb 27 '19 at 09:28
  • Thanks for the link I will check it out. – yasin mohammed Feb 27 '19 at 12:14