I managed to send a message from an MQ Client to a MQ Server. In the MQ Client I amqsputc [queue_local] [name_qmgr]
and after typing the message it return Sample AMQSPUT0 end
which means it was sent properly. But when I try to see the message in the MQ Server with amqsbcg [queue_local] [name_qmgr]
it throws me an error message:
Sample AMQSGET0 start
MQCONNX ended with reason code 2058
This error appears when the queue manager doesn't exist or when the name is misspelled, but this is not the case.
When I verify the local queue it shows CURDEPTH(1)
, this means that there is one message on the queue(it was delivered). But I don't know why it doesn't allow me to get the message. In the queue manager error file it only shows something like:
the channel AMQ.... connection ended
I checked the channel I configured for this test:
AMQ8414: Display Channel details.
CHANNEL(A03ZCIWAS) CHLTYPE(SVRCONN)
ALTDATE(2017-09-07) ALTTIME(00.35.17)
CERTLABL( ) COMPHDR(NONE)
COMPMSG(NONE)
DESCR(Server-connection to ...)
DISCINT(0) HBINT(300)
KAINT(AUTO) MAXINST(100)
MAXINSTC(90) MAXMSGL(4194304)
MCAUSER(nobody) MONCHL(QMGR)
RCVDATA( ) RCVEXIT( )
SCYDATA( ) SCYEXIT( )
SENDDATA( ) SENDEXIT( )
SHARECNV(10) SSLCAUTH(REQUIRED)
SSLCIPH( ) SSLPEER( )
TRPTYPE(TCP)
AMQ8414: Display Channel details.
CHANNEL(A03ZCIWAS) CHLTYPE(CLNTCONN)
AFFINITY(PREFERRED) ALTDATE(2017-09-07)
ALTTIME(02.40.42) CERTLABL( )
CLNTWGHT(0) COMPHDR(NONE)
COMPMSG(NONE) CONNAME(XX.XX.XX.XX)
DEFRECON(NO)
DESCR(Client connection to ....)
HBINT(300) KAINT(AUTO)
LOCLADDR( ) MAXMSGL(4194304)
MODENAME( ) PASSWORD( )
QMNAME(AEDMQ03A) RCVDATA( )
RCVEXIT( ) SCYDATA( )
SCYEXIT( ) SENDDATA( )
SENDEXIT( ) SHARECNV(10)
SSLCIPH( ) SSLPEER( )
TPNAME( ) TRPTYPE(TCP)
USERID( )
The CONNAME(xx.xx.xx.xx)
is the right IP adress for the MQServer and the variable MQSERVER is set like:
MQSERVER=[channel_svrconn]/tcp/'ip_adress_MQServer(1414)'
The port is also fine.
The output you provide indicates you are executing amqsget
not amqsbcgc
.
I note that your question mentions amqsbcg
not amqsbcgc
. The c
at the end of the sample name indicates it is the client version of the program.
amqsbcg = Server Binding version
amqsbcgc = Client version
If you execute either amqsget
or amqsbcg
and specify a queue manager that is not local on the same server you will receive a 2058
.
Solution is to use amqsgetc
or amqsbcgc
instead of amqsget
or amqsbcg