Before you run the Coordinated Request Reply Global Cache sample, configure the broker to use the default global cache. Set the following broker property by using the mqsichangebroker command.
mqsichangebroker MB8BROKER -b default
For the change to take effect, you must restart the broker.
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, 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:
In the Coordinated Request Reply JMS application, you must use the JMSObjects.defs file with the JMSAdmin tool.
Before you can use the JMSAdmin tool, you must modify the JMSAdmin.config file.
To modify the JMSAdmin.config file, complete the following steps:
# 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 initial context # for the service provider. It currently refers to a File System Context. # Examples of an LDAP root context URL and the JNDI namespace for WebSphere # are also shown, commented out. # #PROVIDER_URL=ldap://localhost/o=ibm,c=us PROVIDER_URL=file:/C:/JNDI-Directory #PROVIDER_URL=iiop://localhost/
If you are running the sample on Linux, create the directory for the PROVIDER_URL, /home/<myuser>/JNDI-Directory
Use IBM Websphere MQ Explorer to determine on which port the queue manager is listening.
To change the port used in the sample, complete the following steps: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 JMSAdmin tool and by using the JMSObjects.defs file as input.
On the command line, enter the following commands:
cd mq_install_dir\java\bin JMSAdmin < "workspace_path\Coordinated Request Reply JMS Application\JMSObjects.def"
cd mq_install_dir/java/bin . ./setjmsenv ./JMSAdmin < workspace_path/Coordinated Request Reply JMS Application/JMSObjects.def
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.
The JMS connection properties for all JMS nodes used in this sample are configured by using the JMSProviders configurable service. To configure the JMS nodes with the Connection factory name and the location of the .bindings file that you have just created, complete the following step.
On the WebSphere Message Broker command console, enter the following command:
cd runtime_install_dir\bin "workspace_path\Coordinated Request Reply JMS Application\JMSConfigServices.bat"
cd runtime_install_dir/bin ./workspace_path/Coordinated Request Reply JMS Application/JMSConfigServices.sh
The message flows are now configured, and are ready to be deployed to the broker.
To deploy the Request, Reply, BackendReplyApp, and RestoreOriginalJMSHeader flows, create a broker archive (BAR) file that contains all message flows.
To create the BAR file, complete the following steps.
You are now ready to run the sample.