Author |
Message
|
stone |
Posted: Tue Mar 04, 2008 6:24 am Post subject: using amqsget0.c and amqsget0.c under Linux |
|
|
Newbie
Joined: 04 Mar 2008 Posts: 5
|
Hello
My goal is to put and get a simple message on a queue.
I need to use the amqsget0.c and amqsget0.c example programs to accomplish that.
Client programs work on one machine and MQ Server on the other.
I hope I'm quite far with that but still not succeeded
I installed MQ client and MQ server on both machines.
On a server machine I create the default Queue Manager and a queue as follows:
crtmqm -q MY.QUEUE.MANAGER
strmqm MY.QUEUE.MANAGER
runmqsc
define qlocal (MY.QUEUE)
end
I compile a client programs on a client machine as follows:
gcc -o amqsget0 amqsget0.c -I /opt/mqm/inc/ -L /opt/mqm/lib/ -lmqic
gcc -o amqsput0 amqsput0.c -I /opt/mqm/inc/ -L /opt/mqm/lib/ -lmqic
I set the MQSERVER variable on a client machine as follows:
export MQSERVER='CHAN1/TCP/my.ip.address'
and run the priviously compiled program:
./amqsput0 MY.QUEUE MY.QUEUE.MANAGER
Unfortunately I receive the following error message:
Sample AMQSPUT0 start
MQCONN ended with reason code 2059
I can see the TCP SYN sent from a client to a server machine on port 1414 and a TCP RST packet sent other way.
What else should I do to "put" a message on a server queue ang "get" it back.
I'm using a trial MQ package for Linux:
WMQv600Trial-x86_linux_2.tar.gz
Great thanks for help |
|
Back to top |
|
 |
Vitor |
Posted: Tue Mar 04, 2008 7:01 am Post subject: Re: using amqsget0.c and amqsget0.c under Linux |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
stone wrote: |
crtmqm -q MY.QUEUE.MANAGER
strmqm MY.QUEUE.MANAGER
runmqsc
define qlocal (MY.QUEUE)
end
|
Did you create a listener as well? Or a channel called CHAN1?
You should check out the Clients manual, which will help. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
stone |
Posted: Thu Mar 06, 2008 4:18 am Post subject: Re: using amqsget0.c and amqsget0.c under Linux |
|
|
Newbie
Joined: 04 Mar 2008 Posts: 5
|
Great thanks for an answer but it wasn't helpful to me.
As you can see I'm new to MQ.
The documentation is large.
I feel a great lack of simple fully working examples.
IBM provides simple C examples but from my point of view they just do not work.
It requires me to spend a few weeks trying to lunch those examples under linux.
Please write me a list of MQ instructions of how to configure MQ to lunch those 2 programs since otherwise the trial period may turn out to be to short for an MQ newbie
Thanks again for any help |
|
Back to top |
|
 |
markt |
Posted: Thu Mar 06, 2008 4:32 am Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
If you read the documentation, you will find many simple examples. Including step-by-step instructions such as these. |
|
Back to top |
|
 |
stone |
Posted: Thu Mar 06, 2008 6:03 am Post subject: |
|
|
Newbie
Joined: 04 Mar 2008 Posts: 5
|
Great thanks for help.
I configured the channel and a listener on a receiving machine as follows:
define listener (listener1) trptype (tcp) control (qmgr)
define channel (CHAN1) chltype (rcvr) trptype (tcp)
Now the communication looks much better but amqsput0.c still returns:
MQCONN 2059 error message.
My tcpdump now shows me STATUS_DATA message with error flag set.
Of course on a client machine I set:
export MQSERVER='CHAN1/TCP/my.ip.address'
If you know what can be wrong let me know please.
Sorry for bothering You again and great thanks for any help  |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 06, 2008 11:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Wrong type of channel. RCVR channel is a receiver to be matched up to a sender from a different qmgr.
What you need is a SVRCONN type channel.
Reads: client manual, Intercommunications manual
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|