|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
making sample work in client mode |
« View previous topic :: View next topic » |
Author |
Message
|
paustin_ours |
Posted: Mon Jul 30, 2012 1:21 am Post subject: making sample work in client mode |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
I ran the mqcaptture sample that comes with rfhutil ih03. It works in server mode and i am able to connect to local qmgr.
the code source has been given and trying to compile it to work in client mode.
Looking at the C code i saw these statements
Quote: |
#ifdef _DEBUG
#ifdef MQCLIENT
static char Level[]="mqcapture.c V1.33 Client Debug version ("__DATE__" "__TIME__")\n";
#else
static char Level[]="mqcapture.c V1.33 Debug version ("__DATE__" "__TIME__")\n";
#endif
#else
#ifdef MQCLIENT
static char Level[]="mqcapture.c V1.33 Client Release version ("__DATE__" "__TIME__")\n";
#else
static char Level[]="mqcapture.c V1.33 Release version ("__DATE__" "__TIME__")\n";
#endif
#endif |
Quote: |
#ifdef MQCLIENT
clientConnect2QM(parms.qmname, &qm, &(parms.maxMsgLen), &compcode, &reason);
#else
connect2QM(parms.qmname, &qm, &compcode, &reason);
#endif
|
So i added a
to the code and compiled it, now it does print out mqcapture.c V1.33 Client Release version in the output but i still get a 2058 when connecting to the queue manager.
I looked at the application programming guide for some help but I am still not sure what else needs to be added to the C program to make it work in client mode
should the #define MQCLIENT have some value? Please help!  |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jul 30, 2012 2:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You are barking up the wrong tree:
Code: |
2058 0x0000080a MQRC_Q_MGR_NAME_ERROR |
This means that the qmgr name you supplied does not match the qmgr retrieved...
You typically receive this error if you have compiled with the server libraries instead of the client libraries..., or indeed if the qmgr name supplied does not match with the qmgr name of any of the qmgrs on the box (server) ( or the qmgr defined by host, channel and port (client): not sure about this one, I believe for the client case the reason code is different)
See the client manual and client channel definition table about the meaning or *qmgrname...
Anyways why aren't you using RFHUtilc for the client connect???
Have fun  _________________ MQ & Broker admin
Last edited by fjb_saper on Mon Jul 30, 2012 2:08 am; edited 1 time in total |
|
Back to top |
|
 |
zpat |
Posted: Mon Jul 30, 2012 2:07 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
All MQ client connections need to know the QM name, Connection string (address and port), channel name.
If you have any of these missed it won't work.
Look at how to use a CCDT (Client Channel Definition Table). |
|
Back to top |
|
 |
paustin_ours |
Posted: Mon Jul 30, 2012 2:24 am Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Thanks Guys,
I am not using rfhutil because, i want this to be run as a script and scheduled to back up messages. I like the fact that this sample writes output in the eact format as rfhutilc and therefore i can choose to load message using rfhutilc later if needed.
That said, i used the makefile that came with the sample to copile the code
Quote: |
CC=gcc
INC=-I/opt/mqm/inc -I.
LIB=-L/opt/mqm/lib64 -lmqm
all: mqcapture
mqcapture: mqcapture.o qsubs.o comsubs.o
$(CC) ${INC} -o mqcapture mqcapture.o qsubs.o comsubs.o ${LIB}
|
i pointed to the 64 bit libraries, should i be pointing to client libraries other than the ones in /opt/mqm/lib64?
When i do
export MQSERVER=svrconn/TCP.... setting i am able to go a amqsputc and amqsgetc on the same queue manager without any errors
but when i use this compiled sample, it throws the 2058, it does look like i am not using the client libraries, but not sure how to make it point to client libraries? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jul 30, 2012 2:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
That's because your lib statement points to the server library....
Use instead
Quote: |
LIB=-L/opt/mqm/lib64 -lmqmc |
Hope this helps  _________________ MQ & Broker admin |
|
Back to top |
|
 |
paustin_ours |
Posted: Mon Jul 30, 2012 2:58 am Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Thanks, i read through the MQ client manual and it clearly states to use lmqic for client libraries.
i pointesd to lmqic instead of lmqm and it worked fine.
Thanks again. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jul 30, 2012 6:56 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
zpat wrote: |
All MQ client connections need to know the QM name, Connection string (address and port), channel name. |
The QM name is entirely optional. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|