Forum Discussion

FlorianHeere's avatar
FlorianHeere
New Contributor
2 years ago

Configure JMS for Websphere IBM MQ 9

Hello everyone,

I´am trying to configure JMS for get connected to Websphere IBM MQ. The help does not give any clue how to connect to a remote queuemanager.

It only points to a local installation, which I do not have and therefore I am missing the config-values/syntax of the values. I have to set:

1. Initial Context Class:

2. Provicer URL:

3. Connection Factory JNDI Name:

I have tried it with:

1. initial.context.class.name=com.sun.jndi.fscontext.RefFSContextFactory
2. tcp://host:port/channel-name

3. connection.factory.name.template=com.ibm.mq.jms.MQQueueConnectionFactory

When I test my JMS-Configuration I am getting an error like this:

"Could not establish a JMS connection: javax.naming.InvalidNameException: tcp://XXX:2110/XXX [Root exception is java.net.MalformedURLException: unknown protocol: tcp]"

 

Would be glad, if someone has an example for Webspere IBM MQ

Regards,

Florian

3 Replies

  • Bailoze's avatar
    Bailoze
    New Contributor

    I have the same problem.

    Were you able to find a solution?

    • nastester's avatar
      nastester
      Regular Contributor

      I have a project setup that uses MQTT/JMS to connect to a Websphere IBM MQ instance.

      This wasn't super easy to set up. 

      You will need the following:

      • bindings file (used by JNDI fscontext)
      • additional jars in lib folder
      • update to ready-api.bat file
      • configuration within ReadyAPI

       

      In your ready-api.bat file you need to add the following JVM parameter:

      -Dcom.ibm.mq.cfg.useIBMCipherMappings=false

      The additional jars you need:

      • fscontext
      • jms
      • providerutil
      • com.ibm.mq.allclient

       

      The bindings file was created by the team that manages the WebSphere MQ software and provided to us. It has information regarding the queues including the connection factory name (which you need for setting up in ReadyAPI).

      You'll need to open ReadyAPI with the .bat file so it uses the JVM parameter.

      In JMS settings, you need to set the Initial Context Factory class, Provider URL (path to the bindings file) and connection factory name.

      In my test cases, I publish a MQTT message which is routed to the QM.

      I then use a JMS Request to consume the message off the queue. You need to use an existing request or create a new request. I used the petstore GET. From there, you can create an existing JMS endpoint or create a new one.