Skip to main content

Using JMSReader with IBM WebSphere MQ

The following summary assumes that you are, or are working with, an experienced WebSphere system administrator. This has been tested on WMQ version 7.5.

WMQ Configuration

  1. If an appropriate user account for use by JMSReader does not already exist, create one. Specify this as the value for JMSReader's UserName property.

  2. Add the Striim user to the mqm group.

  3. Create a QueueManager.

  4. Start the QueueManager’s listener.

  5. Create a server connection channel for the QueueManager.

  6. Create a queue.

  7. Copy JMSAdmin.config from <WMQ installation location>/java/lib/ to the JNDI-Directory where you want to create the binding for use by Striim.

  8. Edit this file and set INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory and PROVIDER_URL=<path from root>/JNDI-Directory.

  9. Using MQ Explorer, under JMS administered objects create a new initial context and connection factory as described in chapter 3 of IBM's white paper, "Configuring and running simple JMS P2P and Pub/Sub applications in MQ 7.0, 7.1, 7.5 and 8.0." Specify this connection factory's name (for example, StriimCF) as the value for JMSReader's ConnectionFactoryName property.

  10. Create a JMS queue using the queue, initial context, and connection factory from the steps above. Specify this queue's name (for example, StriimJMSQueue) as the value for JMSReader's QueueName property.

The following steps may also be necessary:

  • Provide access to MCAUSER and configure CHLAUTH rules accordingly.

  • Configure firewall to allow inbound connections if needed.

Striim configuration

  1. Copy the following files from <WMQ installation location>/java/ to Striim/lib and restart Striim:

    • com.ibm.mq.jms.jar

    • com.ibm.mq.jmqi.jar

    • com.ibm.mq.headers.jar

    • fscontext.jar

    • providerutil.jar

    • jms.jar

    • com.ibm.mq.allclient.jar

  2. Using the JMSAdmin tool, generate a .bindings file for the JMSReader. Details on the use of the JMSAdmin tool are available in IBM's documentation. The following example creates a sample .bindings file.

    Example 1. Using JMSAdmin to create a .bindings file
    $ cd /opt/mqm/java/bin
    -- sample JMSAdmin.config
    $ cat JMSAdmin.config
    INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    PROVIDER_URL=file:///tmp/jndi
    SECURITY_AUTHENTICATION=none
    $ mkdir /tmp/jndi
    $ ./JMSAdmin
    InitCtx> DEFINE QCF(mqqcf) QMGR(QM1) tran(client) chan(DEV.APP.SVRCONN) host(localhost) port(1414)
    InitCtx> DEFINE Q(DEV.QUEUE.1) QUEUE(DEV.QUEUE.1) QMGR(QM1)
    InitCtx> END


  3. Copy the .bindings file from the JNDI-Directory you created above to a location accessible to Striim (for example, /users/striim/JNDI). This is the location to specify in JMSReader's Provider property. Since this is a file, set JMSReader's Ctx property to com.sun.jndi.fscontext.RefFSContextFactory.

  4. Edit the .bindings file and change all occurrences of localhost with the IP address of server hosting the queue. For example, if the IP address were 198.51.100.1, you would change localhost(1414) to 198.51.100.0(1414).

JMSReader properties

With the above configuration, the JMSReader properties would be:

CREATE SOURCE WMQSource using JMSReader (
  connectionfactoryname:'mqqcf',
  Ctx:'com.sun.jndi.fscontext.RefFSContextFactory',
  Provider:'file:/users/striim/JNDI/',
  Queuename:'StriimJMSQueue',
  username:'striim',
  password:'******'
) ...