In this sample, WebSphere MQ is used as the JMS provider; you must create the administered objects by using the JMSAdmin tool.
Before you start:
If you are running the sample on Linux you must complete the following steps:
>mq_install_directory</java/lib/com.ibm.mqjms.jar
>JAVA_HOME</bin
The following instructions assume that WebSphere MQ is installed in the mq_install_dir directory. The JMSAdmin tool and JMSAdmin configuration file 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 broker is not using port 2414, edit the port setting in JMSSampleObjects.defs.
On the command line, enter the following commands:
cd mq_install_dir\java\bin JMSAdmin < "workspace_path\JMSNodesSampleFlowProject\JMSSampleObjects.defs"
cd mq_install_dir/java/bin . ./setjmsenv ./JMSAdmin < "workspace_path/JMSNodesSampleFlowProject/JMSSampleObjects.defs"
Where WebSphere MQ is installed in the following location: mq_install_dir, and workspace_path is the full path to the WebSphere Message Broker Toolkit workspace directory.
The objects and the .bindings file are created.
Next, modify a JNDI object and an MQInput node attribute:
mq_install_dir\java\bin\JMSAdmin
mq_install_dir/java/bin/JMSAdmin
Where WebSphere MQ is installed in the following location: mq_install_dir.
alter q(publishqueue) queue(PUBLISHQUEUE)
end
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 broker.
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.