You installed WebSphere MQ as part of the installation of WebSphere Business Integration Connect. WebSphere MQ includes a JMS implementation, which you can use to set up JMS communication.
WebSphere MQ is not configured for JMS by default, however. This section provides the steps to configure JMS.
You first create a directory for JMS. For example, suppose you wanted to create a directory named JMS in the c:\temp directory of a Windows installation. These are the steps you would follow:
In this section, you update the JMSAdmin.config file, which is part of the WebSphere MQ installation, to change the context factory and provider URL.
INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory PROVIDER_URL=ldap://polaris/o=ibm,c=us
#INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory #PROVIDER_URL=file:/C:/JNDI-Directory
PROVIDER_URL=file:/c:/temp/JMS
In this section, you use WebSphere MQ to create the queues you will use to send and receive documents and the channel for this communication. It is assumed that a queue manager has been created. The name of the queue manager should be substituted where <queue manager name> appears in the following steps. It is also assumed that a listener for this queue manager has been started on TCP port 1414.
strmqcsv <queue manager name>
runmqsc <queue manager name>
def ql(<queue_name>)
For example, to create a queue named JMSIN, you would enter:
def ql(JMSIN)
def ql(<queue_name>)
For example, to create a queue named JMSOUT, you would enter:
def ql(JMSOUT)
def channel(<channel_name>) CHLTYPE(SVRCONN)
For example, to create a channel named java.channel, you would enter:
def channel(java.channel) CHLTYPE(SVRCONN)
end
Enter the following command to add a Java run time to your system path:
set PATH=%PATH%;<path to installation directory>\_jvm\jre\bin
where installation directory refers to the directory where WebSphere Business Integration Connect is installed.
To define the JMS configuration, perform the following steps:
JMSAdmin
define ctx(jms)
change ctx(jms)
define qcf(WBICHub) tran(CLIENT) host(<your_IP_address>) port(1414) chan(java.channel) qmgr(<queue manager name>)
define q(<name>) queue(<queue name>) qmgr(<queue manager name>)
define q(<name>) queue(<queue name>) qmgr(<queue manager name>)
end
As an example, the following is the JMSAdmin session used to define the queue connection factory as WBICHub, with an IP address of sample.ibm.com where the MQ queue manager resides (<queue manager name> of sample.queue.manager). The example uses the JMS queue names and channel name created in Creating queues and the channel. Note that user input follows the > prompt.
InitCtx> define ctx(jms) InitCtx> change ctx(jms) InitCtx/jms> define qcf(WBICHub) tran(CLIENT) host(sample.ibm.com) port(1414) chan(java.channel) qmgr(sample.queue.manager) InitCtx/jms> define q(inQ) queue(JMSIN) qmgr(sample.queue.manager) InitCtx/jms> define q(outQ) queue(JMSOUT) qmgr(sample.queue.manager) InitCtx/jms>end