Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to send to a remote queue without having MQ locally?

Status
Not open for further replies.

cl8855

Programmer
Nov 28, 2000
47
0
0
US
We are designing a solution where multiple boxes (NT/Unix) will be sending messages to one local box. Is it possible to have an application on those boxes write to an MQ Queue on our local box without having MQ loaded on each and every one of those other boxes?

thanks,
chad
 
Not only is it possible, it is one of the fundamental methods for connecting to a Queue Manager!

What you want to establish is an MQ Client connection. There is a manual dedicated to this on the IBM MQSeries web site.

You'll need to install the MQ Client components onto each machine unless you use Java, in which case just the MQ jar file is required.

Paul
 
Paul -

You mentioned, "You'll need to install the MQ Client components onto each machine unless you use Java, in which case just the MQ jar file is required."

What is the name of the jar file you referred to? I am trying to get a JMS application to consume from a remote queue.

Regards - Mark
 
Interesting... this is one of the things that I have been working on, except that I was trying to accomplish this using the ActiveX components... That may explain why the application will run on the server, but will not run remotely... Any thoughts??

gordon
 
mq.jar (I believe) is in the install directory, usually under lib/java (can't recall exactly).

However, unless this has changed with MQ 5.2, you will need to downloadd the support pac in order to be able to use JMS. It is here:

It all works very well although MQ does not support XA transactions using JMS yet.

For JMS you need to add a directory entry for your connection factory using JNDI. If not, you can use the MQ-specific connection factory but you lose out on code portablilty. You need to do this for your topics too if you're using PubSub.

Cheers,
Paul
 
Paul -

The complete list of jar files in <install-dir>\java\lib is:
com.ibm.mq.iiop.jar
com.ibm.mq.jar
com.ibm.mqbind.jar
com.ibm.mqjms.jar
fscontext.jar
jms.jar
jndi.jar
ldap.jar
providerutil.jar

The install notes for IBM JMS state that the CLASSPATH should include com.ibm.mq.jar, com.ibm.mq.iiop.jar, and the \lib directory.

Is the &quot;mq.jar&quot; you mentioned the same as com.ibm.mq.jar?

I noticed something else at the link you provided. IBM JMS requires IBM's JDK. I have been using the Sun JDK; this might be the cause of my problems. Will change and try again.

Supported JDK versions:

AIX - IBM JDK 1.2.2, 1.3.0
AS/400 - IBM JDK 1.2.2
HP-UX 10-20 - HP JDK 1.1.8
HP-UX 11 - HP JDK 1.2.2, 1.3.0
Linux for Intel - IBM JDK 1.3.0
Linux for S/390 - IBM JDK 1.2.2
Solaris - Sun JDK 1.2.2, 1.3.0
Windows 95, 98, NT - IBM JDK 1.2.2, 1.3.0
Windows 2000 - IBM JDK 1.3.0

Best regards - Mark
 
Paul -

Changing to IBM's JDK seems to have improved the situation, ie, I no longer receive VerifyError's.

Do you know where I can find documentation on MQJxxxx error codes and reasons?

For example:
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = {0}
MQJE001: Completion Code 2, Reason 2009

I do not see anything in the docs that come with the JMS-classes download.

Best regards - Mark
 
Yes, mq.jar is the one you mention. Use the CLASSPATH as recommended and it should work. I have used Sun's JDK with no problems and am currently using whatever is supplied with JBuilder 4, again without problems. Regarding the message, if it's not in the MQ-Java manual then I don't know where you'll find it - you might need to download the latest version to get the JMS info. But the reason code given is the standard MQ Reason as found in the MQ Messages manual.

Here is what I am doing:

import com.ibm.mq.*;

MQEnvironment.hostname = &quot;my.host.com&quot;;
MQEnvironment.channel = &quot;SYSTEM.DEF.SVRCONN&quot;;
MQEnvironment.port = 1414;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);

QMgr = new MQQueueManager(args[1]);

Cheers,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top