In this sample, WebSphere MQ is used as the JMS provider; you must create the administered objects by using the JMSAdmin tool.
Note: If multiple versions of WebSphere MQ are available, select the version currently installed as your primary queue manager.
The following instructions assume that WebSphere MQ is installed in the mq_install_dir directory. The JMSAdmin tool and JMSAdmin configuration file, called JMSAdmin.config, are in the following locations:
Before you can use the JMSAdmin tool, you might need to modify the JMSAdmin.config file.
# The following line specifies which JNDI service provider is in use. # It currently indicates a File System Context. If a different # service provider is used, this line must be commented out, and the # appropriate one must be uncommented. # # com.sun.jndi.fscontext.RefFSContextFactory is the FileSystem JNDI Context # #INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory #INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory #INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory # # The following line specifies the URL of the service provider's initial # context. It currently refers to an File System Context. Examples of a # LDAP root context URL and WebSphere's JNDI namespace are also shown, commented # out. # # PROVIDER_URL needs changing to, e.g. file:///home/user/JNDI-Directory # on Unix platforms. The 'JNDI-Directory' folder needs to be created in the # location specified. # #PROVIDER_URL=ldap://localhost/o=ibm,c=us PROVIDER_URL=file:/C:/JNDI-Directory #PROVIDER_URL=iiop://localhost/
Now you can create the objects.
By running the WebSphere MQ JMSAdmin tool, you create the JNDI administered objects to configure the JMS Connection Factories and Destinations that are used in the sample.
You create the objects by running the JMSAdmin tool and by using the JMSSampleObjects.defs file as input.
If your integration node is not using port 2414, edit the port setting in JMSSampleObjects.defs.
On the command line enter the following commands, replacing mq_install_dir with the WebSphere MQ install location and replacing workspace_path with the full path to the IBM Integration Toolkit workspace directory:
cd mq_install_dir\java\bin JMSAdmin < "workspace_path\JMSNodesSampleFlowProject\JMSSampleObjects.defs"
cd mq_install_dir/java/bin . ./setjmsenv
Running the setjmsenv command sets up the JMS environment and adds com.ibm.mqjms.jar to the CLASSPATH. Java is required by JMSAdmin and if it is not already set in your PATH it can be added with the following command, where JAVA_HOME is the install location of Java:
export PATH=$PATH:JAVA_HOME/bin
Then run the following JMSAdmin command:
./JMSAdmin < "workspace_path/JMSNodesSampleFlowProject/JMSSampleObjects.defs"
The objects and the .bindings file are created in the directory specified by the PROVIDER_URL that was set in the JMSAdmin.config file above.
Next modify an MQInput node attribute to connect it to the .bindings file.
You must inform the JMS nodes in the message flows where to find the .bindings file that you just created.
To configure the JMS nodes with the location of the .bindings file:
The message flows are now configured, and are ready to be deployed to the integration node.
To deploy the JMSGateway and JMSInput_Publication flows, create a broker archive (BAR) file that contains both message flows.
To create the BAR file:
You are now ready to run the sample.