Setting up the JMS Nodes sample

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.

Creating the administered objects by using JMSAdmin

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.

Validating and modifying the JMSAdmin.config file

  1. In a text editor, open the JMSAdmin.config file.
  2. To comment out any options that are not required, add a number sign (#). To uncomment any option, remove the number sign (#).
    #  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/	
    
  3. Ensure that the PROVIDER_URL is set to /C:/JNDI-Directory, or an equivalent location on Linux, and INITIAL_CONTEXT_FACTORY is set to com.sun.jndi.fscontext.RefFSContextFactory.
  4. If you have made any changes, save the file.
  5. Create the PROVIDER_URL directory if it does not already exist.

Now you can create the objects.

Creating 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:

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.

Configuring the JNDI path in the message flows

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:

  1. In the Application Development view, double-click the file JMSGateway.msgflow in the JMS Nodes Sample Flow Project. This action opens a message flow editor where you can edit the JMSGateway message flow.
  2. Right-click the JMSOutput node in the message flow, click Properties to show the Properties view.
  3. In the Properties pane, select the JMS Connection tab.
  4. Ensure that the value shown in the Location JNDI Bindings field matches the path specified in the PROVIDER_URL line in the JMSAdmin.config file. If these two values are not the same, the message flow will not work.
  5. Save the message flow.
  6. Open the JMSInput_Publication message flow in the Message Flow editor, and configure the JMSInput node with the location of the .bindings file by using the previous steps.

The message flows are now configured, and are ready to be deployed to the integration node.

Creating the BAR file and deploying the message flows

To deploy the JMSGateway and JMSInput_Publication flows, create a broker archive (BAR) file that contains both message flows.

To create the BAR file:

  1. In the Application Development view, right-click, then click New > BAR file.
  2. Select the "JMSNodesSampleFlow Project" and enter a name for the BAR file.
  3. Click Finish. A pane headed Prepare opens. This pane displays the options for creating a new broker archive file.
  4. Ensure both flows have been added to the BAR file by checking the box by JMSNodesSampleFlowProject, then save your options (Ctrl+S).
  5. Now build the BAR file by clicking the Build broker archive button. The BAR file that you have created appears in the BAR folder for the JMSNodesSampleFlowProject in the Application Development view.
  6. Click the BAR file and drag it to the default integration server in the Integration Nodes view. This action deploys the flows onto the integration node.

You are now ready to run the sample.

Back to sample home