Configuring IBM MQ for access by WebSphere's JNDI namespace
Configure the IBM MQ queues for access by WebSphere®'s JNDI namespace rather than the typical file URL.
About this task
To configure IBM MQ:
Procedure
- You should set the shared library path for UNIX and LINUX systems as follows:
set <Shared_Library_Path_Name>=<mqjava_install_path>/libwhere the <Shared_Library_Path_Name> is the shared library path environment variable for your operating system. For example:
- In AIX® it is LIBPATH.
- In Linux® it is LD_LIBRARY_PATH.
- Modify the <mqjava_install_path>/bin/JMSAdmin.config file
as follows:
INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory PROVIDER_URL=CORBAloc:://<WAS_admin_IP_address>:<WAS_bootstrap_port> - Create an ivtsetup.scp command
file that contains the following parameters:
def qcf( <QCFName> ) qmgr(<QManagerName>) transport(CLIENT) host(<ipaddress of Server> ) channel(SYSTEM.DEF.SVRCONN) port( <PORT> ) def q(JNDINameOfQueue) qu(QueueName)In the following example, a
QueueConnectionFactoryis created with the JNDI nameivtQCF. ThisQueueConnectionFactoryis configured to access the Queue Manager SYSTEM.TEST. Using the 'CLIENT' (network based) transport on the computer 127.0.0.1,through port 1414 (IBM MQ default), through the server connection channel named SYSTEM.DEF.SVRCONN (IBM MQ default).Next, a queue object is created with the JNDI name getATP, which is configured to work with the getATP queue on QueueManager SYSTEM.TEST. (Of course, you must ensure that you have created this queue on the queue manager as well.)
Finally, an end command is issued to shut down JMSAdmin.
Note that the .scp file can have any name, but the convention is ivtsetup.scp (ivt=installation verification test).
def qcf(ivtQCF) qmgr(SYSTEM.TEST) transport(CLIENT) host(127.0.0.1) CHANNEL(SYSTEM.DEF.SVRCONN) port (1414) def q(getATP) qu(getATP) QMGR(SYSTEM.TEST) end - Set the PATH and CLASSPATH in the JMSAdmin
script as follows:
MQJAVA_PATH=<path to ma88 installation> PATH=$MQJAVA_PATH CLASSPATH=$MQJAVA_PATH/lib:$MQJAVA_PATH/lib/com.ibm.mq.jar:$MQJAVA_PATH/lib/ com.ibm.mqjms.jar:$MQJAVA_PATH/lib/jms.jarFor information about WebSphere JARs, see IBM® documentation
-
Pass the .scp file to the IBM MQ JMSAdmin class using
the following syntax:
java com.ibm.mq.jms.admin.JMSAdmin < intsetup.scp