Friday, July 25, 2014

JMeter and WebSphere MQ Series integration

    JMeter is a popular tool for executing load tests. There is much information about it on the web. However, integration of JMeter with WebSphere MQ Series (JMS provider) is not that common. Let's try to do it!
The goal is to send a particular number of messages per second using JMeter and WebSphere MQ as a message broker. The first thing to do is to generate .binding file. That file contains information about message broker and queue to which we want to connect. You can use WebSphere MQ Explorer and follow this link for instructions regarding .binding file creation. Make sure that you specified the right address to message broker (for some reason there was 'localhost' set in my .binding file) within ConectionFactory and the channel name is also correct. Once you obtain .binding file you should prepare JMeter. First of all WebSphere MQ client jars:
must be copied to:
folder. Then you need to create a test plan:
Make sure that you specified the right localization of the folder containing .binding file and ConnectionFactory and Destination names are exactly the same as you specified during .binding file creation.
JMeter is ready to go. You can start torturing your application. Have fun!


  1. This is almost helpful. If you could explain about the .binding file and examples of the ConnectionFactory and Destination names... and maybe text version of the InitialContextFactory. thanks.

    1. I think I'm in a similar boat - I connect using Camel which have never needed a bindings file

    2. I think I'm in a similar boat - I connect using Camel which have never needed a bindings file

  2. For those trying to get this working I also stumbled upon this blog that helped me with the initial idea, and here is what I had to do to finally make it work.

    Have an MQ Client installed (not necessarily on the JMeter server) - I did this using MQ Client for Windows.

    1 - Needed to add additional libs from MQ + the ones listed to Jmeter/lib (such as fscontext for context factory)
    My final list was.

    2 - Create the dir JNDI-Directory on the C: drive. You will need this to save .bindings file.

    3 - To create the bindings file go to an MQ client install (:IBM\WebSphere MQ\java\bin) and run JMSAdmin.bat

    In the command prompt - define the parameters as below, replacing your values.

    InitCtx> def qcf(connection_factory_name) transport(CLIENT) channel(mq_channel) host(mq_server_hostanem) port(mq_server_port) qmgr(mq_qmgr_name)
    InitCtx> def q(destination_q_name) qmgr(mq_qmgr_name) queue(destination_q_name)
    InitCtx> end

    This will create the .bindings file that you will move to the JMeter Server and reference in the JMS Publisher sampler.

    Initial context is the same as in the screenshot. All other parameters are self explanatory.

    In my version of JMeter the JMS Publisher sampler has an expiration and priority fields, which if I left blank throw a Java error. I set them to 9999 and 4 respectively.

    Hope this helps.

  3. I have JMeter sending message to MQ Server to which i have full access. But my JMeter is throwing the following error:

    Response message: javax.naming.NamingException: javax.naming.InvalidNameException: tcpip:// [Root exception is unknown protocol: tcpip]

    What could be the issue?

    1. This comment has been removed by the author.

  4. I could not install MQ Client for Windows - as it is throwing another errror:

    -> Could not create the Java Virtual Machine.



  5. It is nice articles, sure helps for load performance testing on application side. But message queue has own storage, it stores all messages even it process or not.

    Websphere MQ Admin Training online and class room

    Websphere MQ Admin Training in Chennai

  6. This is a very very useful article. Thank you so much.

  7. Hi
    We have ActiveMQ broker and JMS messaging, We developed application (Desktop application in JavaFX) which uses ActiveMQ to send and receive data, Server side also ActiveMQ installed which receive data and update in database with different flags and later response will be delivered to client.
    Here ActiveMQ installed in client side and server side to communicate JMS mechanism.
    My scenario:
    Desktop application can be installed in different machines which treated as number of clients, How can we do load test in this scenario.

  8. This is a vey very useful article.Thank you.