You use the JMSAdmin utility to store the JNDI information about the system where WebSphere MQ is installed.
Note: The instructions in this procedure use a file-based JNDI. If you are using another JNDI provider, you will need to adapt these steps.
Follow these steps:
Note: For a file-based JNDI, the INITIAL_CONTEXT_FACTORY and PROVIDER_URL are the only parameters that you need.
The InitCtx> prompt appears indicating that you are connected to the initial context factory and provider URL you defined in the configuration file.
Note: For information about the JMSAdmin utility, see the WebSphere MQ JMS Administration Tool.
DEFINE QCF(connectionfactory) TRANSPORT(CLIENT) QMGR(queuemanager) HOSTNAME(host) PORT(port)
DEFINE Q(destination) QMGR(queuemanager) QUEUE(queuename)
DISPLAY CTX
The JMSAdmin utility displays lines for your two definitions.
The JNDI information is stored.
Example: Store the Information for a File-based JNDI on UNIX
This example creates a subdirectory /var/mqm/fsjndi on a UNIX file system. The subdirectory contains a .bindings file that stores the WebSphere MQ queue connection information.
Follow these steps:
./opt/mqm/java/bin/setjmsenv
cd /var/mqm mkdir fsjndi
cp $MQ_JAVA_INSTALL_PATH/bin/JMSAdmin.config MyJMSAdmin.config
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory PROVIDER_URL=file:/var/mqm/fsjndi
MQ_JAVA_INSTALL_PATH/bin/JMSAdmin -cfg MyJMSAdmin.config
DEFINE QCF(MY_QUEUE_CF) TRANSPORT(CLIENT) QMGR(queue.manager) HOSTNAME(somehost) PORT(1414)
DEFINE Q(MY_QUEUE) QMGR(queue.manager) QUEUE(MY.QUEUE)
DISPLAY CTX
The JMS Admin utility displays the following lines.
.bindings java.io.File MY_QUEUE_CF com.ibm.mq.jms.MQQueueConnectionFactory MY_QUEUE com.ibm.mq.jms.MQQueue
Note: You can copy the entire fsjndi subdirectory to anywhere you want on any computer you want. Update the Provider URL parameter that is used during queue connections to the corresponding location.
|
Copyright © 2014 CA.
All rights reserved.
|
|