This section describes how to set up the hub to use the JMS transport. If you will be using the JMS transport to send documents from the hub or to receive documents at the hub, follow the procedures in this section. If you will not be using the JMS transport, skip this section.
In later sections of this document, you will learn how to set up JMS targets or gateways (or both). These tasks are described in Setting up a JMS target and Setting up a JMS gateway.
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%;<ProductDir>\_jvm\jre\bin
where ProductDir refers to the directory where WebSphere Partner Gateway is installed.
To define the JMS configuration, perform the following steps:
JMSAdmin
define ctx(<context_name>)
change ctx(<context_name>)
For example, if the context_name is JMS, the commands look like this:
define ctx(JMS)
change ctx(JMS)
define qcf(connection_factory_name) 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
The previous steps created the .bindings file, which is located in a subfolder of the folder you specified in step 5. The name of the subfolder is the name you specified for your JMS context.
As an example, the following JMSAdmin session is used to define the queue connection factory as Hub, 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(Hub) 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
In this example, the .bindings file would be located in the following directory: c:/temp/JMS/JMS, where c:/temp/JMS is the PROVIDER_URL and JMS is the context name.