Configuring Rational Software Development Platform Test Environment 6.0 to use a WebSphere MQ 5.3 Queue

December 12th, 2005

If you have ever tried to get a Message Bean working in Rational Software Development Platform 6.0 and Websphere MQ 5.3, you would know why this tutorial is needed good luck….

As you go through this tutorial there are things to keep in hand

  • Queue Manager Name : QM_headley (default on my machine)
  • Queue Manager Port :1414 (default)
  • Queue name: headleyqueue (created this under QM_headley in MQ explorer )
  • File System url : file:/C:/JNDI-Directory/mq
  • File System JNDI Connection Factory name : headleyCF
  • File System JNDI Queue name : headleyq
  • Websphere Provider Connection Factory name: jms/headleyCF
  • Websphere Provider Queue name: jms/headleyq
  • Listener port name: headleyListener
  • Test Java code: QueueTest.java QueuePut.java

In MQ 5.3 explorer

  • Create Queue Manager or Use default Queue Manager
  • Create a queue in MQ series i.e. “headleyqueue

Use there MQ’s JMSAdmin tool to set up bindings for the Queue

  • It can be found under -> C:\Program Files\IBM\WebSphere MQ\Java\bin
  • Edit JMSAdmin.config to be a file system provider set the follwoing
  • INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
  • PROVIDER_URL=file:/C:/JNDI-Directory
  • SECURITY_AUTHENTICATION=none
  • Create folder file:/C:/JNDI-Directory
  • run JMSAdmin.bat and set up bindings for the Test client
  • def ctx(mq)
  • chg ctx(mq)
  • def qcf(headleyCF) qmgr(QM_7bs7j31)
  • def q(headleyq) queue(headleyqueue)
  • Test queue with this sample application

    QueueTest -url file:/C:/JNDI-Directory/mq (you need to have all the jar file in C:\Program Files\IBM\WebSphere MQ\Java\lib in your classpath to run)
    In Rational Software Development Platform Test Environment 6.0

    • Create Test Project
    • Create Test Package
    • Create Test MessageBean
    • Create Test Server
    • Add Bean to Websphere Test Server
    • Start Websphere Test Server
    • Run Admin console and select server1 by right clicking server

    Login into Admin Console with any ID


    • Configure Websphere MQ JMS provider
    • Configure “Websphere MQ queue connection factories”under Resources/JMS providers/Websphere MQ/ in the Additional properties section (second one from the top)

    Click new

    Fill out the following fields

    Name: headleyCF (made up name)

    JNDI Name: jms/headleyCF (made up JNDI name)

    Queue Manager: QM_headley (default)

    Host: localhost

    Port :1414

    Don’t forget to SAVE after pressing Apply and OK

    • Configure “Websphere MQ queue destinations factories”under Resources/JMS providers/Websphere MQ/ in the Additional properties section (third one from the top)
    • Click new

    Fill out the following fields

    Name: headleyCF (made up name)

    JNDI Name: jms/headleyq (made up JNDI name)

    Base Queue name: headleyqueue (from MQ series)

    Base Queue Manager name: QM_headley (default on my machine)

    Queue Manager Host: localhost

    Queue Manager Port :1414

    Don’t forget to SAVE after pressing Apply and OK

    • Configure Listener Ports with JNDI names from Connection Factory and JMS Destinations created in previous two steps.

    First select server1 under Servers/ApplicationServers.

    Then under communications select messaging/ message listening service

    Then click Listener Ports

    Then Click new

    Fill out the following fields

    Name: headleyListener (made up name)

    Connection Factory JNDI Name: jms/headleyCF

    Destination JNDI name: jms/headleyq

    Don’t forget to SAVE after pressing Apply and OK

    Do not try to start Listener, it will start when you restart the server

    • Configure Message Bean with Listener Ports

    In J2ee view double click bean and fill in the Listener port Name: headleyListener

    • Restart Server

    Test with MessageBean Test

    QueuePut -url file:/C:/JNDI-Directory/mq (you need to have all the jar files in C:\Program Files\IBM\WebSphere MQ\Java\lib in your classpath to run)

    Technorati Tags: , , , , , ,

    One Response to 'Configuring Rational Software Development Platform Test Environment 6.0 to use a WebSphere MQ 5.3 Queue'

    1. Great Tasting Java » Blog Archive » JNDI look up in Websphere 6.0 to Test MQ 5.3 Queue, Message Beans with JMS says:

      December 12th, 2005 at 2:13 pm

      [...] JNDI look up in Websphere 6.0 to Test MQ 5.3 Queue, Message Beans with JMS December 12th, 2005 If you have read my other post Configuring Rational Software Development Platform Test Environment 6.0 to use a WebSphere MQ 5.3 Queue I used JMSAdmin as my service provider for inserting objects into the queue. QueueIBMTest.java uses websphere 6.0 as my service provider to insert items in an MQ queue using JMS. It will use a Websphere test server as its provider. So once you have websphere MQ connections set up you can use this tool to test your message bean. Of course you need to edit the connection factory and queue name to what ever you set in websphere. You are going added the following jars to your class path in RAD to get it to work. C:Program FilesIBMRationalSDP6.0runtimesbase_v6lib naming.jar namingclient.jar namingserver.jar You will also need all the jars files in C:Program FilesIBMWebSphere MQJavalib in your classpath to run To Run: Java QueueIBMTest [...]

    Leave a Comment