Configure the WebSphere® MQ queues for access by WebSphere's JNDI namespace rather than the typical file URL.
To configure WebSphere MQ:
set <Shared_Library_Path_Name>=<mqjava_install_path>/lib
where the <Shared_Library_Path_Name> is the shared library path environment variable for your operating system. For example:
INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
PROVIDER_URL=CORBAloc:://<WAS_admin_IP_address>:<WAS_bootstrap_port>
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 QueueConnectionFactory is created with the JNDI name ivtQCF. This QueueConnectionFactory is configured to access the Queue Manager SYSTEM.TEST. Using the 'CLIENT' (network based) transport on the computer 127.0.0.1,through port 1414 (WebSphere MQ default), through the server connection channel named SYSTEM.DEF.SVRCONN (WebSphere 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
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.jar
For information about WebSphere JARs, see IBM® documentation
java com.ibm.mq.jms.admin.JMSAdmin < intsetup.scp