|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How To Connect To Remote Queue Manager ? |
« View previous topic :: View next topic » |
Author |
Message
|
debugme |
Posted: Thu Jan 22, 2004 9:17 am Post subject: How To Connect To Remote Queue Manager ? |
|
|
 Apprentice
Joined: 14 Jan 2004 Posts: 27
|
Dear Friends,
I have MQ 5.3 installed on a Win2K box called WinBox01.
I have an MQ application running on a Solaris 5.8 box called
SunBox01. This box does NOT run any version of MQ. I
have managed to compile it using the Solaris binaries and
the fantastic amount of help the kind people on this forum
have extended to me.
What I need to do, is make the application on SunBox01
'connect' to the local queue manager on WinBox01 and
query it for various queue attributes.
My connection code looks like this for a local connection,
when I run the application on WinBox01. But I am not sure
what changes to make in it, so it can be run on SunBox01
and connect to WinBox01's queue manager.
Both the boxes are connected on a local network, of course
Code: |
MQCHAR* queueManagerName = ...
MQHCONN connection = ...
MQLONG statusCode = ...
MQLONG reasonCode = ...
MQCONN(queueManagerName, &connection, &statusCode, &reasonCode);
...
|
Any snippets in C would be much appreciated...
regards, Asad. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jan 22, 2004 9:24 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You can relink your program to use the client libraries (mqic) as opposed to the server libraries (mqm). You can then export an environment variable (MQSERVER=SYSTEM.DEF.SVRCONN/TCP/hostname) and run your program remotely as an MQ client. You'll need to make sure that you have a listener running on the MQ machine.
If you search this site for amqsputc, you'll probably find some appends regarding the testing of your client connection. |
|
Back to top |
|
 |
debugme |
Posted: Mon Jan 26, 2004 1:37 am Post subject: Thanks, but what about... |
|
|
 Apprentice
Joined: 14 Jan 2004 Posts: 27
|
Dear bower5932,
Thanks for the suggestions. I don't have a problem
recompiling with the client libraries, but exactly how
would I export an environment variable ? Also how
would I set-up a listener ?
I guess these questions may seem dumb, but this is
my first job out of university and the learning curve
is pretty steep for a newbie like me...
regards, Asad. |
|
Back to top |
|
 |
JasonE |
Posted: Mon Jan 26, 2004 2:43 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
In unix, its generally something like
EXPORT MQSERVER='channelname/TCP/hostname.domain.com(port)'
eg
EXPORT MQSERVER='SYSTEM.DEF.SVRCONN/TCP/127.0.0.1(1414)'
You can set it in your .profile for a specific user, or globally somehow for all users (not sure how).
For a listener on the windows box, bring up the MQ Services GUI, expand MQSeries, click on the QMgr you are trying to connect to
If there is a 'Listener' in Running state, you can use that already, you just need to know the port (right mouse on it, properties, find the Port in the tabbed pane)
If there isnt, right mouse on rhs panel in the gap, then New->Listener. Fill in the port (dont fill in local addr) and click ok, then start it (rightmouse on the listener, Action->Start
From the command line you can use amqmdain crtlsr, but I'll leave that as an exercise for the reader (amqmdain is documented in 5.3 docs) |
|
Back to top |
|
 |
debugme |
Posted: Tue Jan 27, 2004 4:52 am Post subject: Thanks again for all your help ! |
|
|
 Apprentice
Joined: 14 Jan 2004 Posts: 27
|
Dear Jason,
This is great !
Thanks for being so generous with both your time and knowledge.
I have been making steady progress with my work, thanks to the
enormous amount of help, which I have received from yourself
and others like you on this forum.
regards, Asad. |
|
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
|
|
|
|