Author |
Message
|
mquser925 |
Posted: Tue Apr 22, 2008 7:31 am Post subject: Connecting to an mqserver using the mqclient |
|
|
Acolyte
Joined: 22 Apr 2008 Posts: 61
|
Here is my situation, I did a search and was unable to find a solution. I am running mq series 6.0 on redhat linux. I have created an mq queue manager and assigned a queue and channel on one machine and started the queue manager and started the listener. I am trying to connect to that queue on another machine where the mq client is installed using amqsputc. I have listed my script below.
#mq script
crtmqm TEST
strmqm TEST
runmqsc TEST << EOF
DEFINE QLOCAL (TEST1.QUEUE) REPLACE
DEFINE CHANNEL (TEST1.SVRCONN) CHLTYPE(SVRCONN)+
TRPTYPE(TCP) MCAUSER(' ') REPLACE
EOF
runmqlsr -m TEST -t TCP -p 1414
This is all done on machine A. I then logon to machine B, define the environment variable:
export MQServer=TEST1.SVRCONN/TCP/'xx.xxx.x.xx(1414)'
and try to place a message in the queue using:
amqsputc TEST1.QUEUE TEST
I get the following error:
MQCONN ended with error code 2058
Any ideas?
I made sure that the port was open so I know that is not the problem. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Apr 22, 2008 11:36 am Post subject: Re: Connecting to an mqserver using the mqclient |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mquser925 wrote: |
export MQServer=TEST1.SVRCONN/TCP/'xx.xxx.x.xx(1414)'
|
Assuming you've done the put in the same window, so the variable is in scope, try MQSERVER not MQServer
Not connected to your problem, but if you're using v6 define a listener within the queue manager rather than use runmqslsr - newer, faster, better, more shiny, etc, etc _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 22, 2008 3:12 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mquser925 wrote: |
export MQServer=TEST1.SVRCONN/TCP/'xx.xxx.x.xx(1414)' |
Try instead
Code: |
export MQServer='TEST1.SVRCONN/TCP/xx.xxx.x.xx(1414)' |
Note the subtle difference in the quotes.
If I were you I would also use the DNS name instead of the IP.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Apr 22, 2008 3:20 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
if there was a problem with the MQSERVER variable, wouldn't he be getting a 2059 instead?
mquser, on the machine where you set MQSERVER, run the amqscnxc command. On the server where the QM is running, run the dspmq command. Post the output of both here. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 22, 2008 3:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
PeterPotkay wrote: |
if there was a problem with the MQSERVER variable, wouldn't he be getting a 2059 instead?
mquser, on the machine where you set MQSERVER, run the amqscnxc command. On the server where the QM is running, run the dspmq command. Post the output of both here. |
Peter I figure that the problem is not with the variable but with the way it is defined and that the content of the variable did not take. As such the qmgr is not local and the 2058 refers to the local qmgrs...
An echo ${MQServer} should easily clear that. _________________ MQ & Broker admin |
|
Back to top |
|
 |
Nigelg |
Posted: Tue Apr 22, 2008 10:00 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
I agree with Vitor, the variable should be MQSERVER (all caps), not MQServer.
The position of the quotes does not make any difference. The purpose of the quotes in that command is to protect the () from the shell.
The error is 2058 not 2059 because with no valid MQSERVER variable, the client channel table is searched instead. Since there is no entry with the qmgr name TEST, 2058 is returned. _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Apr 22, 2008 10:08 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
i didnt see any clntconn channel he has created...isnt that necessary or what
Regards
Gayathri _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 23, 2008 12:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Gaya3 wrote: |
i didnt see any clntconn channel he has created...isnt that necessary or what
|
Not if connection is with MQSERVER, which bypasses the client connection table. Check the Clients manual.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Gaya3 |
Posted: Wed Apr 23, 2008 12:57 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
, but i usually create both at one shot...and play around it..
Vitor wrote: |
Gaya3 wrote: |
i didnt see any clntconn channel he has created...isnt that necessary or what
|
Not if connection is with MQSERVER, which bypasses the client connection table. Check the Clients manual.  |
Regards
Gayathri _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
mquser925 |
Posted: Wed Apr 23, 2008 1:05 am Post subject: brilliant! |
|
|
Acolyte
Joined: 22 Apr 2008 Posts: 61
|
You guys are very knowledgeable, the problem was that MQServer != MQSERVER. Thank you very much. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 23, 2008 1:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Gaya3 wrote: |
, but i usually create both at one shot...and play around it..
|
Valid but pointless, and likely to confuse this poster, who would have created a clntconn and got no further with his problem.
Play about with it? I'd love your workload, but you need better toys. A clntconn can't be much fun....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mquser925 |
Posted: Wed Apr 23, 2008 6:06 am Post subject: Re: Connecting to an mqserver using the mqclient |
|
|
Acolyte
Joined: 22 Apr 2008 Posts: 61
|
Vitor wrote: |
Not connected to your problem, but if you're using v6 define a listener within the queue manager rather than use runmqslsr - newer, faster, better, more shiny, etc, etc |
Question:
I tried to define a listener,
runmqsc TEST
DEFINE LISTENER(TESTLISTENER) CONTROL(QMGR) TRPTYPE(TCP)+ PORT(1414)
and I get an error with the name. The name is anything I desire correct? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 23, 2008 6:10 am Post subject: Re: Connecting to an mqserver using the mqclient |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mquser925 wrote: |
and I get an error with the name. The name is anything I desire correct? |
It's subject to the same naming rules as an WMQ object.
And my v6 queue manager has no problem with a listener called that. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dgolding |
Posted: Wed Apr 23, 2008 6:13 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
Nothing wrong with the name (except it's not the most informative ) - take the "+" sign out of the line - that'll help - and put TRPTYPE(TCP) as the first parameter - it seems to insist on it |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 23, 2008 6:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dgolding wrote: |
TRPTYPE(TCP) as the first parameter - it seems to insist on it |
So it does!!!!
Never noticed that before. When I tried it, I automatically typed TRPTYPE as the 2nd parameter because I always do. Never realised there was actually a reason for it!
This forum is so informative!!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|