Reputation: 15144
When running the GET sample amqsget
I can connect normally in the queue...
C:\Program Files\IBM\MQ\bin>amqsget QUEUE1
Sample AMQSGET0 start
no more messages
Sample AMQSGET0 end
However when using amqsgetc
I get an error "MQCONNX ended with reason code 2058":
C:\Program Files\IBM\MQ\bin>amqsgetc QUEUE1
Sample AMQSGET0 start
MQCONNX ended with reason code 2058
Explicitly adding the queue manager at the end does not work as well.
This article from IBM summarizes the problem causes but it still not clear why one is working and not the other. This other article explains the sample programs.
Upvotes: 2
Views: 3147
Reputation: 774
amqsget will connect to a queue manager on your local machine using shared memory pipes. This means as long as it is on the same machine as your queue manager it can find the queue manager and connect to it.
amqsgetc will connect to a queue manager over the network. Because, by default, it doesn't know where the queue manager is you will need to tell it how to connect to the queue manager. You can tell amqsgetc (or any client application) how to connect ot a queue manager in one of 3 ways:
<Channel>/<Network Protocol, most likely TCP>/<address>(<port>)
for example Channel1/TCP/localhost(1414)
. This page has more details about MQSERVER.Upvotes: 3
Reputation: 129
The sample programs ending with 'c' are linked with the MQ client libraries, rather than the server libraries. As such they connect with a network connection (typically TCP) rather than shared memory.
The article you link to provides further information on the order of precedence used by the when working out how to reach a remote queue manager, but to summarise, it's likely that the client doesn't know how to contact the queue manager.
You will need to advise the client of the connection details to use to contact the queue manager, either with a CCDT, or using the MQSERVER environment variable.
Upvotes: 2