Loadtesting Websphere IBM MQ server using JMETER

 

 About :

For Loadtesting Apache Active MQ , JMS-Point-to-Point sampler in Jmeter will help us. Think that you do not have JNDI settings and no apache activemq for JMS messaging, instead IBM Websphere MQ is in place.  One day your manager is coming and asking you to test IBM MQ using open source testing tool as they do not ready to pay for small scale performance testing.

In that case , here is the steps to use Jmeter to load test IBM Websphere MQ.
The content here is pretty much precious as I have spent almost 2 months to figure out.Hence it will save your valuable time 🙂

  • Below are the Java and MQ jars needed.  Download these jar files and place it under Jmeter’s libext directory. ‘jmeter-jms-skip-jndi-0.0.1.jar‘ is the jar contains the MQ declaration and coding to connect it. You can down it from the URL :http://www.java2s.com/Code/Jar/j/Downloadjmeterjmsskipjndi001jar.htm
    • com.ibm.mq.jar
    • org.springframework.beans.jar
    • org.springframework.jms.jar
    • javax.jms.jar
    • jmeter-jms-skip-jndi-0.0.1.jar
    • spring-core.jar
  •  Open Jmeter -> File-> New->TestPlan -> Add Thread Group
  • Under Thread Group add Samplers->JMS Point-to-Point Sampler and configure the parameter. As given in the below Screenshot.
  •  Run Jmeter Script and Enjoy IBM MQ load testing .

MQ1

130 Comments

  1. The attached screenshot is not very clear and I could not do the settings as specified.
    Please re-attach the screen shot.

  2. Hi Suganthi/Sandeep
    Can you give me some sample xml content which I can use for testing.

    I get the NULL pointer exception error when I test it, I feel the content is not in proper format..

  3. awesome, though it’s simplified from yogesh’s blog. I was getting the class not found errors unless i include the jar files in the run time in the thread group…

    • Hi Anand,

      It is right but I have never included class files in Jmeter class path. Instead I will always place all the external jar files to lib/ext folder and set JAVA_HOME environmental variable.

  4. hi Sugandhi,

    I am getting below error after running the test by adding JAR’s in the Lib.

    Response code:
    Response message: javax.naming.NoInitialContextException: Cannot instantiate class: com.elega9t.jmeter.jms.testing.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.elega9t.jmeter.jms.testing.InitialContextFactory ]

    can u please help to correct the error.

    • Hi Saranya,

      It seems like the jar file ‘jmeter-jms-skip-jndi-0.0.1.jar’ is not included / referred by jmeter script. Please ensure that it is placed in the jmeter/lib/ext folder.

      Thanks
      Suganthi

  5. i can see the file jmeter-jms-skip-jndi-0.0.1.jar included in lib ext directory.Kindlyb help in resolving this error.
    error description:
    Thread Name: Thread Group 1-1
    Sample Start: 2014-02-19 12:29:35 IST
    Load time: 0
    Latency: 0
    Size in bytes: 0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Response code:
    Response message: javax.naming.NoInitialContextException: Cannot instantiate class: com.elega9t.jmeter.jms.testing.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.elega9t.jmeter.jms.testing.InitialContextFactory ]

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

    • Hi Saranya,

      Did you set JMETER_HOME environmental variable? If you set this environment variable, Jmeter should be able to access your jars automatically. Can you confirm this?

      Regards
      Suganthi

  6. You saved my life. This worked perfectly. I wasted quite some time on this before I found this post.

  7. Hi Suganthi, could you help to look into why below error message display? how to fix it?
    Thread Name: Thread Group 1-1
    Sample Start: 2014-04-10 15:58:19 CST
    Load time: 1
    Latency: 0
    Size in bytes: 0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Response code:
    Response message: java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

    • Hi Iris,

      It seems like you have not added IBM MQ jar file. Please Ensure the following jar files in your jmeter/lib/ext folder.

      • com.ibm.mq.jar
      • org.springframework.beans.jar
      • org.springframework.jms.jar
      • javax.jms.jar
      • jmeter-jms-skip-jndi-0.0.1.jar
      • spring-core.jar

      • Thank you, it’s been fixed, I add other jar files as well
        com.ibm.mqjms.jar
        javax.resource.jar
        com.ibm.dhbcore.jar

        But now there is another question:

        it report that NullPointerException as below:
        Thread Name: Thread Group 1-1
        Sample Start: 2014-04-10 17:00:31 CST
        Load time: 0
        Latency: 0
        Size in bytes: 0
        Headers size in bytes: 0
        Body size in bytes: 0
        Sample Count: 1
        Error Count: 1
        Response code:
        Response message: java.lang.NullPointerException

        Response headers:

        SampleResult fields:
        ContentType:
        DataEncoding: null

        Do you have any idea?

        • Suganthi Thangavel

          April 10, 2014 at 3:06 pm

          It means that you MQ is not able to communicate. Can you recheck the parameters as in the image that i have posted.

          1. Queues should start with QUEUE_yourqueuname
          2. check intialcontextfacory (give it as it is in the image)
          3. verify channel,hostname,queuemanager,transportType and port

          • I’ve checked my parameter
            1. Queue is started with QUEUE_
            2. intial contextfactory is same as your image which is com.elega9t.jmeter.jms.InitialContextFactory
            3. I set channel=XXX, host=XXX, queueManager=XXX, port=XXX, and I don’t set transportType, may I know is the parameter name case sensitive? what’s transportType? is it necessary?

          • normally we use keystore to connect MQ together with channel, host, and queueManager etc. but in your example there is setting for keystore related, how can I do in order use keystore to connecting the queue?

          • Hi, please would you reload the image. It seem to have disappeared and this looks like a very useful blog indeed. Thx

          • Thank you Steve.
            Broken link finished

        • Yes transportType is mandatory and case sensitive. For my app it is 1. can u check it by giving tranportType as 1

        • There is no keystore settings needed here. if you are using IBM Websphere MQ, then these settings will lead connecting to IBM MQ from Jmeter.

          • I see..now that error was not existing.
            and comes another error which I searched in internet but no founding yet, sorry to disturb you all the time, would you pls see below error, seems it failed to connect hostname by the queueManager
            Response code:
            Response message: javax.naming.NamingException: MQJMS2005: failed to create MQQueueManager for ‘XXXXXXXX:XXXX’—>(‘Hostname:queueManager’)

        • Suganthi Thangavel

          April 10, 2014 at 5:08 pm

          Initially me too gone through all of these errors.Please recheck your parameter values, you would have done a mistake or given wrong value on Queue manager details.

          • Yes, I’ve gone throung all the parameter setting here, still get the same error code, not sure where is wrong
            QueueConnectionFactory:CONNECTION_FACTORY
            JNDI Request Queue:QUEUE_XXXXXX1
            JNDI Request Queue:QUEUE_XXXXXX2
            Communication stype:request response
            Initial ContextFactory:com.elega9t.jmeter.jms.InitialContextFactory
            channel:TSSXXXX.XXXXXXXX
            port:1414
            hostName:aptXXX1.XXXXXXXX.XXX
            queueManager:APTXXXX
            transportType:1

  8. Hi Suganthi,
    I have installed IBM Websphere MQ in my system and I was able to send message but in JMeter it is not working. Getting the following error.

    Response message: javax.naming.NamingException: MQJMS2005: failed to create MQQueueManager for ‘D-113043666:MQ_Balaji’

    JMS Resources:
    ————–
    Queue Connection Factory: CONNECTION_FACTORY
    JNDI name Request queue: QUEUE_Test01
    JNDI name Receive queue: -blank-

    JNDI Properties:
    —————-
    channel SYSTEM.DEF.CLNTCONN
    hostName D-113043666 (my sys name)
    port 1415
    queueManager MQ_Balaji
    transportType 1

    Please help.

    • Hi Balaji,

      one thing i am able to see is you have given reply to queue ‘blank’. Its mandatory that you have to give valid reply queue as QUEUE_yourqueuename.

      Can you give it and let me know?

  9. I tried everything, finally ending up getting this error…Pls advice…

    Response message: javax.naming.NamingException: MQJMS2013: invalid security authentication supplied for MQQueueManager

    • I did not face this error Balaji. This error seems to be in relation with connection_factory or other related parameters. if you unjar the file ‘jmeter-jms-skip-jndi-0.0.1.jar’ you can see all the parameters assigned internally. Please check this once, you may get some clue and please let me know if you still need my help.

      for my app channel name is ‘SYSTEM.ADMIN.SVRCONN’, if this is common, it may work for you, try this

  10. I verified. Ended up getting,

    Response message: javax.naming.NamingException: MQJMS2013: invalid security authentication supplied for MQQueueManager

    What should be the ‘channel name’…? SYSTEM.AUTO.SVRCONN….?

  11. Hi Suganthi,

    I am getting the below error:
    java.lang.NoClassDefFoundError: com/ibm/msg/client/commonservices/trace/Trace

    Pls Advice..

  12. I am getting below error in jmeter listener

    Thread Name: JMSTestPlan-PointtoPoint 1-1
    Sample Start: 1970-01-01 05:30:00 IST
    Load time: 0
    Latency: 0
    Size in bytes: 0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Response code: 000
    Response message: javax.naming.NamingException: Expected javax.jms.ConnectionFactory, found javax.naming.Reference

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

    pl advise.

  13. Hi,
    Do we need to create a queue connection factory for this setup to work?

    Thank You

    • Hi Nikhil,

      Not needed. Queue connection settings are already there in the jmeter jar file ‘jmeter-jms-skip-jndi-0.0.1.jar’ ,.

  14. Hi… Thanks for this. When I publish a message using the above my message goes in MQHRF2 format. I need to send message in MQSTR format. Any suggestions ?

  15. Hi,

    I need to send 2000 messages on MQ, how shall send the same.

    Regards,
    Mithun

  16. Hi,

    I need to send 2000 messages on MQ, how shall send the same ?

    Regards,
    Mithun

  17. Hi Suganthi,

    i have added all the required jar’s but on running the script i am getting below error,

    2014/07/28 21:39:00 ERROR – jmeter.protocol.jms.sampler.JMSSampler: java.lang.NullPointerException
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:52)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:328)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:599)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:568)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:556)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
    at java.lang.Thread.run(Thread.java:724

    did anyone have noticed this issue? if yes then how it was resolved.

    Thank You !!!

  18. Hi Suganthi,

    I referred your blog and was able to eliminate most of the errors; however, I am getting the response as ‘Response message: No reply message received’. When I checked with the MQ and development team, I was told that the data is being sent in ‘text’ format whereas it should be sent as ‘bytes’.
    Is there a way of sending data as ‘bytes’? I have tried adding the ‘HTTP Header Manager’ and setting the ‘content type = bytes’ but I do not see that being useful.

    Can you suggest anything here?

    • Hi,

      Can you please check that ‘communcation style’ in jms request as ‘ Request Response’ and run the test once again

      Thanks
      Suganthi

  19. Hi Suganthi,
    I was going through your blog and able to resolve some of the initials errors that were coming. Now I am getting below exception and there is no class name mentioned as well.
    Thread Name: Thread Group 1-1
    Sample Start: 2014-10-24 11:06:32 EDT
    Load time: 0
    Latency: 0
    Size in bytes: 0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Response code:
    Response message: java.lang.NoClassDefFoundError

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

  20. I am now able to solve that issue by placing additional jars that were required. Now , I am getting another exception.

    Thread Name: Thread Group 1-1
    Sample Start: 2014-10-24 11:45:15 EDT
    Load time: 0
    Latency: 0
    Size in bytes: 0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Response code:
    Response message: javax.jms.JMSException: MQJMS2008: failed to open MQ queue ”.

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

    I am not sure how to put the queue name on fields “JNDI Name Request Queue” , “JNDI Name Receive Queue”. I have placed as below :
    JNDI Name Request Queue : QUEUE_QM.BRK.TEST
    JNDI Name Receive Queue : QUEUE_QM_BRK_REC_TEST
    Please let me know if it is correct .

  21. Hi Suganthi,

    I am getting below error in JMETER while trying to connect to Queue in remote Queue Manager.

    2014/10/24 13:02:50 DEBUG – jmeter.protocol.jms.sampler.Receiver: Receiver – ctor. Creating consumer with JMS Selector:
    2014/10/24 13:02:50 ERROR – jmeter.protocol.jms.sampler.JMSSampler: MQJMS2008: failed to open MQ queue ”. javax.jms.InvalidDestinationException: MQJMS2008: failed to open MQ queue ”.
    at com.ibm.msg.client.wmq.v6.jms.internal.MQQueueServices.getQueueOpenException(MQQueueServices.java:902)
    at com.ibm.msg.client.wmq.v6.jms.internal.JMSServicesMgr.getQueueOpenException(JMSServicesMgr.java:159)
    at com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createQConsumer(MQSession.java:3072)
    at com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createConsumer(MQSession.java:2391)
    at com.ibm.msg.client.wmq.v6.jms.internal.MQSession.createConsumer(MQSession.java:2450)
    at com.ibm.msg.client.jms.internal.JmsSessionImpl.createConsumer(JmsSessionImpl.java:794)
    at com.ibm.msg.client.jms.internal.JmsSessionImpl.createConsumer(JmsSessionImpl.java:844)
    at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createReceiver(JmsQueueSessionImpl.java:92)
    at com.ibm.mq.jms.MQQueueSession.createReceiver(MQQueueSession.java:121)
    at com.ibm.mq.jms.MQQueueSession.createConsumer(MQQueueSession.java:196)
    at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.getCachedConsumer(CachingConnectionFactory.java:373)
    at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:323)
    at $Proxy1.createConsumer(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.Receiver.(Receiver.java:75)
    at org.apache.jmeter.protocol.jms.sampler.Receiver.createReceiver(Receiver.java:100)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:332)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:597)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:566)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:554)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
    at java.lang.Thread.run(Thread.java:662)

  22. I am now able to connect to Queue Manager and send message using single queue and channel connection. What if i need to connect to different queues using separate channel connection for the same queue manager. Can we increase the queue and channel count using this tool.

    • Hi Gaurav..Good to know that issue is resolved. For the above question, add CSV DATA CONFIG element and give different queue names in the CSV and call that variable name in the respective JMS sampler. Hope this helps you..Do let me know the results.
      Thank you,
      Site admin

  23. Hi Suganthi,

    I have remote queue manager, can i provide remore provide URL and connect through JMETER. will it support remote connection?

    Thanks,
    Bala.J

    • Suganthi Thangavel

      November 18, 2014 at 3:05 pm

      Hi Bala,

      Local or Remote it does not matter.Provide the right queue manager configuration parameters,But it matters when you consider response time as it will add network latency .

  24. Hi,

    Thanks for this awesome page content. I have a question, does the IBM MQ server always require to have the Initial Context Factory(JNDI Properties) configured in order to establish a connection with Jmeter? Is it possible to configure Jmeter by not specifying the Initial Context Factory if the IBM MQ server does not have the Initial Context Factory configured?

    Thank you
    Nick

    • Hi Nick,

      Hi Nick,

      The above settings are given for the scenario where JNDI properties are not available in IBM Webphere MQ . Using Initial context factory properties are given in order to tell client to connect to the right Queue Manager .
      You can use decompiler and see the code written in jmeter-jms-skip-jndi-0.0.1.jar file.

      You can even modify the code and generate your own JAR file.

      • Thanks Suganthi!

      • Hi Suganthi,

        I have another question, I get the following error in the log file while attempting to establish a connection to the IBM MQ server:

        jmeter.threads.JMeterThread: Thread started: Point-to-Point 1-1
        2015/06/05 09:06:09 ERROR – jmeter.protocol.jms.sampler.JMSSampler: MQJMS2013: invalid security authentication supplied for MQQueueManager javax.naming.NamingException: MQJMS2013: invalid security authentication supplied for MQQueueManager

        The IBM MQ server has no authentification information configured so it should accept a connection without specifying a username and a password. Do you know if we have to add the username and password JNDI properties and set their values to ‘string empty’ in Jmeter? Will I have to modify the jmeter-jms-skip-jndi-0.0.1.jar file in order to do so?

        Thank you,
        Nick

  25. Hi Suganthi,

    I have a question concerning the collection of test results. I would like to retrieve the data from the response message and to view it in a file with a timestamp. I’m always receiving the “No reply message received” for each Request. I believe it’s because the application on the other end consumes the request message and produces a new message for the response thus losing the Request Message Identifier. I also noticed that the response message gets consumed once in the Receive queue. I’m wondering where the response messages go after being consumed and are the response messages conserved somewhere in a file after being consumed?

    Thank you,
    Nick

  26. Yes Nick. There are 2 things you have to set it here,
    1) Select communication type as ‘ Request and Response’
    2) Set Timeout little more than usual like ‘500000’ (which is 500 secs)
    3) Also you can not see the message in the explorer as the Jmeter reads it , instead you can view it in Response data of Jmeter , set response assertion, so that you do not need to check each request response.

  27. Thanks Suganthi for your kind response.

    Also, do you know if there’s a way for the request and response messages to not be correlated or must they absolutely be correlated in order to view the Response data in Jmeter?

    Nick

  28. I am not sure about the alternative way of correlation. in other way , yes, Correlation is must in order to see the response.

  29. Hi,

    I am trying to get this working on a MAC and I always get this error.

    Invalid name. Should be ‘CONNECTION_FACTORY’ or should start with ‘QUEUE_’

    I have set queueconnection factory to CONNECTION_FACTORY and tried by using queue name with QUQUE_.

    Thanks for your time.
    -Anand

  30. Hi,

    I am trying to get this working but I am getting the below error:

    Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]

    Can you please help me with this?

    Regards,
    Pradhyumna

    • Hi Prad,

      Can you please give me some more details on what you are trying to test? is it IBM Websphere MQ?

    • Also it seems like you are testing with JNDI settings. If you follow the above steps in the post, with the jars that i specified you have to give the appropriate queue name and queue manager details in JMS point to point sample with no jndi settings.

      • Hi Suganthi,

        Yes it is IBM MQ. I need to put messages at a particular rate for a load test.
        I solved most of the error but now I am getting a class not found error.

        javax/transaction/TransactionManager java.lang.NoClassDefFoundError: javax/transaction/TransactionManager

        Thanks for replying. Much appreciated.

        -Prad

        • Suganthi Thangavel

          August 6, 2015 at 8:43 pm

          It is related to your application/project where you are missing some dependency jar in the project class path.

  31. Hi,

    I encountered the following error(see below), and tried the solutions mentioned in the previous comments but I was still unable to resolve it. Please help. 🙂

    Response message: javax.naming.NamingException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager ‘TEST.QUEUE.MANAGER’ with connection mode ‘Client’ and host name ‘XXX.XX.X.XX(1414)’.

    Thanks in advance!

    • Hi Jonathan,

      Looks like jmeter not able to communicate with MQ server details you provided. Check your queue manager ,host-name and also ensure that queue names starts with ‘Queue_’ at its beginning.

      Thanks
      Suganthi

  32. Suganthi, Thank you for your blog; it is really helpful.
    I am getting the following error; kindly help me. 🙂
    Regards,
    -prasad.

    Settings:-
    CONNECTION_FACTORY
    QUEUE_Req
    QUEUE_Res

    hostname: 127.0.0.1
    port: 1415
    queueManager: Test
    tranportType: 1
    channel: SYSTEM.ADMIN.SVRCONN
    Content: 1|212661223344|EN|Test Message from Prasad

    Error:-
    2015/08/20 22:47:15 INFO – jmeter.threads.JMeterThread: Thread started: Thread Group 1-1
    2015/08/20 22:47:15 ERROR – jmeter.protocol.jms.sampler.JMSSampler: java.lang.NullPointerException
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:53)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:610)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:998)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:980)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)

    2015/08/20 22:47:15 WARN – jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateException: Session may not be null while creating message
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:189)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:145)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
    at java.lang.Thread.run(Unknown Source)

    2015/08/20 22:47:15 INFO – jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1
    2015/08/20 22:47:15 INFO – jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1
    2015/08/20 22:47:15 INFO – jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
    2015/08/20 22:47:15 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)

  33. Hi Suganthi,

    where can I download following Jar files? They are available on the lik you have provided.

    • com.ibm.mq.jar
    • org.springframework.beans.jar
    • org.springframework.jms.jar
    • javax.jms.jar
    • jmeter-jms-skip-jndi-0.0.1.jar
    • spring-core.jar

    Thanks

  34. Hi Suganthi

    Please ignore my previous question. I have download jar files and copied on to /lib/ext folder. Alos. I have set JAVA_HOME and JMETER_HOME correctly.

    Jmeter throws following error. Please advice.

    2015/08/25 16:15:06 ERROR – jmeter.protocol.jms.sampler.JMSSampler: com/ibm/mq/jms/MQQueueConnectionFactory java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:51)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:610)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:998)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:980)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)

    2015/08/25 16:15:06 WARN – jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateException: Session may not be null while creating message
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:189)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:145)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
    at java.lang.Thread.run(Unknown Source)

    2015/08/25 16:15:06 INFO – jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1
    2015/08/25 16:15:06 INFO – jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1
    2015/08/25 16:15:06 INFO – jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
    2015/08/25 16:15:06 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)

  35. Hi Suganthi

    How can I parametrise the queue name instead of hard coding.
    JNDI name Request queue value is set to “QUEUE_postcard” which works fine.

    However JNDI name Request queue value is set to “QUEUE_${Que}” fails .
    where in “Que” is a CVS data set config element.

    Thanks

  36. Hi Suganthi,

    I have sample XML files and I need to push them to MQ. I have got Queue Manager, Queue Manager Cluster and Queue names from Developers.

    What other data do I need to ask from Developer and how to simulate this using JMeter.

    We have IBM MQ9 series in place.

    Thanks,
    Devendra

    • Suganthi Thangavel

      September 22, 2015 at 11:07 am

      That is enough for now. Try follow the specified steps above and let me know if you face any issues.

      • Hi Suganthi ,

        Your blog is awesome,

        Please help me as we are testing IBM MQ ,
        I have a JMeter JMS Point to Point test in which I am sending an some data packets onto a queue which should go further and response is expected,instead i am getting

        “No reply message received”
        If I set the ‘communication-style’ to ‘Request Only’ the test passes. All my connections are correct and I am using JMeter version 2.13 with all IBM MQ JMS implementation jars.
        I have also changed the jmeter.properties file to enable JMSSampler.useSecurity.properties=false. This has not worked.

        Please help us to fix this issue

        • Suganthi Thangavel

          October 28, 2015 at 7:19 pm

          Thanks Kiran.

          I think you are getting that due to timeout issue .Keep the communication-style as “Request Response” and Increase the timeout to some 15mins which is 900000 milliseconds , this is max value if response does not come still , you have to check whether it is a performance issue.

  37. Hi Suganthi,

    Awesome blog .

    Could you help me in this how can i send request for different queues through distributed jmeter(using 1 machine as mater and other 2 are slaves )?

  38. I have the same problem as PerfTester.

    I downloaded all needed jars from http://www.java2s.com/
    com.ibm.mq.jar
    org.springframework.beans.jar
    org.springframework.jms.jar
    javax.jms.jar
    jmeter-jms-skip-jndi-0.0.1.jar
    spring-core.jar

    and saved to apache-jmeter-2.13libext path

    Anyone could upload working libraries to for example dropbox?

    2015/11/10 17:25:49 ERROR – jmeter.protocol.jms.sampler.JMSSampler: com/ibm/mq/jms/MQQueueConnectionFactory java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:51)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:610)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:998)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:980)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: com.ibm.mq.jms.MQQueueConnectionFactory
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    … 10 more

    2015/11/10 17:25:49 WARN – jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateException: Session may not be null while creating message
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:189)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:145)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
    at java.lang.Thread.run(Unknown Source)

    2015/11/10 17:25:49 INFO – jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1
    2015/11/10 17:25:49 INFO – jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1
    2015/11/10 17:25:49 INFO – jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
    2015/11/10 17:25:49 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)

    • Hi,

      can you check your jms parameters added

    • Hi Guys,
      did you find the solution for NOCLASSDEF error?

      • issue has been resolved,
        it needs some more jars than sugandi specified

        the issues and fixes are like below
        • Response message: javax.naming.NoInitialContextException: Cannot instantiate class: com.elega9t.jmeter.jms.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.elega9t.jmeter.jms.InitialContextFactory]
        Solution: place jmeter-jms-skip-jndi-0.0.1.jar in JMETER_HOME/lib/ext
        • Response message: java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory
        Solution: added com.ibm.mq.jar, org.springframework.beans.jar ,org.springframework.jms.jar, javax.jms.jar &
        spring-core.jar in JMETER_HOME/lib/ext still same issue  .
        Added “dhbcore.jar” JMETER_HOME/lib/ext, this issue resolved
        • Response message: java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
        Solution: add “javaee.jar in” in JMETER_HOME/lib/ext

        ping me if you face any other issues

  39. I am getting following error. Please help/suggest.

    ERROR – jmeter.threads.JMeterThread: Test failed! java.lang.NoSuchMethodError: com.ibm.mq.jmqi.handles.Hconn.getQsgName()Ljava/lang/String;
    at com.ibm.msg.client.wmq.internal.WMQConnection.(WMQConnection.java:542)
    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7192)
    at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6583)
    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:295)
    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6232)
    at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:115)
    at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:345)
    at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:295)
    at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:227)
    at org.springframework.jms.connection.SingleConnectionFactory.createQueueConnection(SingleConnectionFactory.java:244)
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:60)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:610)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:998)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:999)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:980)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)

  40. Anyone could upload working jar’s to for example dropbox?

  41. Hi Suganthi,

    We have installed MQ Explorer in the same machine, from here we are able to connect to the Queues, from JMeter end do we need to get any details from MQ to set? like initialContextFactory and queueConnectionFactory or can we give whatever has been given in the above image?

  42. Hi All,

    i would like to send messages which are in a file,
    how can i achieve this ?

    thank you

    • Suganthi Thangavel

      February 4, 2016 at 2:45 pm

      Give the messages in the CSV file and parameterize it in Jmeter. If you have a line of message as input , then use line separator
      in csv config element instead of comma delimeter
      ${__BeanShell(System.getProperty(“line.separator”);)} – give this expression in the place of delimeter

      • Hi Suganthi,
        thanks for the reply

        i did like this
        1. added CSV config, which has single column and more data
        2. ${__BeanShell(System.getProperty(“line.separator”);)} – added this at delimeter option
        3. specified ${Data} in CONTENT

        Result:
        message sent to the queue is EOF,
        i’m unable to attach images here else explanation would have been better.

        Thanks

        • Suganthi Thangavel

          February 10, 2016 at 2:17 pm

          Are you referring the input as ‘Data’ ? If so can you attach Debug Sampler and see what is being sent to ${Data}?

          • Yes i’m referring input as Data,
            in debug sampler i can test=,

            if you have such configuration, can you attach a screenshot here please?

  43. I am using Point to Point sampler from JMS to send message to MQ Queue

    I am able to telnet to MQ server.

    when i run my script in JMeter – i am getting the following error:

    Response message: javax.naming.NameNotFoundException: myQueueName

    Let me know what the issue is?

  44. Hi,
    Could you please help? I double checked all the jmeter test plan settings as per your screenshot. I added all jars. I am getting following error and not able to find why it is showing this error. I have following filled:
    QueueConnection Factory: CONNECTION_FACTORY
    JNDI name from request queue: QUEUE_
    JNDI name from Receive queue: QUEUE_
    Communication Style: Request Response
    both use ids checked
    Timeout: 10000
    content is filled

    Initial Context Factory: com.elega9t.jmeter.jms.InitialContextFactory
    channel
    hostName
    port
    queueManager
    tranportType
    is filled

    I get this error:

    Thanks for help.

    Praveen
    2016/09/25 20:47:55 ERROR – jmeter.protocol.jms.sampler.JMSSampler: java.lang.NullPointerException
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:56)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:647)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:616)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:604)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:237)
    at java.lang.Thread.run(Unknown Source)

    2016/09/25 20:47:55 WARN – jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateException: Session may not be null while creating message
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:189)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:145)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
    at java.lang.Thread.run(Unknown Source)

  45. I am good now, it was one of the property miss spelled, namely transportType

  46. Thank you much. This blog is very useful.

  47. Hi Sandeep,

    I need to send messages from JMeter to MQ Queues & getting weird errors.

    Have tried changing the initial context factory to 3 separate values, but i get different errors.

    Following is my folder where i have 3 screenshots, after making a few changes.
    https://drive.google.com/open?id=0BxpRhNRXZZ2TaXZ2MnBRNlhLTEU

    I do have JAVA_HOME & JMETER_HOME in my settings and classpath.

    Please let me know what is the issue?
    Thanks

  48. Hi All,
    I tried everything given in this blog but still stuck with the following error:

    jmeter.protocol.jms.sampler.JMSSampler: javax/transaction/TransactionManager java.lang.NoClassDefFoundError: javax/transaction/TransactionManager
    at com.ibm.mq.jms.MQConnection.(MQConnection.java:512)

    I absolutely have no working experience with JMeter. Can anyone help!!!

  49. Hi,

    Trying to create JMS Sampler for sending messages to IBM Websphere MQ Topics. Try to resolve the below error by changing multiple values, jars, gone through the lot of blogs but could not resolved. Please can you help in this regard.
    Response message: javax.naming.NamingException: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]

  50. I have installed all the specified jar files but still getting the below error. Can you please help

    ERROR – jmeter.protocol.jms.sampler.JMSSampler: com/ibm/mq/jms/MQQueueConnectionFactory java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory
    at com.elega9t.jmeter.jms.InitialContextFactory$1.lookup(InitialContextFactory.java:51)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:329)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:647)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:996)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:978)
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:616)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:604)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:237)
    at java.lang.Thread.run(Unknown Source)

  51. I am getting following error: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

    please help me to resolve the same

  52. Now getting this error:

    Thread Name: Thread Group 1-1
    Sample Start: 2016-11-22 14:04:40 IST
    Load time: 0
    Latency: 0
    Size in bytes: 0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Response code:
    Response message: javax.naming.NoInitialContextException: Cannot instantiate class: com.elega9t.jmeter.jms.testing.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.elega9t.jmeter.jms.testing.InitialContextFactory]

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

  53. How to set JMETER_HOME, i have no idea, please provide detailed steps

  54. First of all. Thanks a lot for the brillinat post. It is indeed useful for me. I was trying out with various tools for load testing MQ until i found this on internet. I am completely new for load testing MQ. Could you please help me out ? I am not sure what to configure if i have to send the COBOL format messages or XML format in the content. Please advise, Thanks in advance!

    • Sandeep Sadanandan

      March 6, 2017 at 2:16 pm

      Hi Vathshen,

      Can you let me if it is still not resolved. I need more details why you need xml input, is it http protocol?

  55. Can you please help.! I have given all the details, i still see the error as below. Coudnt locate what is the issue.
    Thread Name: Thread Group 1-1
    Sample Start: 2017-03-01 21:47:07 IST
    Load time: 0
    Connect Time: 0
    Latency: 0
    Size in bytes: 0
    Sent bytes:0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Data type (“text”|”bin”|””): text
    Response code:
    Response message: java.lang.NullPointerException

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

  56. Hi Sandeep

    Great Post. Just attempting for the first time to connect to IBM MQ. I have a similar error to what a few other people have had

    Thread Name: Thread Group 1-1
    Sample Start: 2017-03-07 09:10:50 PST
    Load time: 0
    Connect Time: 0
    Latency: 0
    Size in bytes: 0
    Sent bytes:0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Data type (“text”|”bin”|””): text
    Response code:
    Response message: javax.naming.NoInitialContextException: Cannot instantiate class: com.elega9t.jmeter.jms.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.elega9t.jmeter.jms.InitialContextFactory]
    Response headers:
    SampleResult fields:
    ContentType:
    DataEncoding: null

    Which version of the MQ Jars files is required?
    For further info, I am using Jmeter 3.1.

  57. Thanks for the Reply Suganthi.
    I had copied in the jmeter-jms-skip-jndi-0.0.1-sources.jar instead of jmeter-jms-skip-jndi-0.0.1.jar by mistake so I have moved on to a different error.
    I have copied in all the other jars mentioned in this blog(as below) in to the JMETER lib/ext folder
    com.ibm.mq.jar
    org.springframework.beans.jar
    org.springframework.jms.jar
    javax.jms.jar
    jmeter-jms-skip-jndi-0.0.1.jar
    spring-core.jar
    dbhcore.jar
    com.ibm.dhcore.jar

    But am still receiving the ERROR – jmeter.protocol.jms.sampler.JMSSampler: com/ibm/mq/jms/MQQueueConnectionFactory java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory

    Where am I going wrong? I am using Websphere 7.5 and Jmeter 3.1

  58. Eventually resolved the issue. Added the following additional jar files and it worked.

    com.ibm.mq.commonservices.jar
    com.ibm.mq.headers.jar
    com.ibm.mq.jmqi.jar
    com.ibm.mq.mqjms.jar
    connector.jar
    javax.resource.jar

  59. Thanks for such a detailed Blog. I have gone through all the steps. Placed Jar files and given all details. My request was success too. But Request is not available in queue.
    Requirement : I need to post a message is IBM MQ and I have ETL job that reads the message.
    Here while reading the Queue through ETL job, I am getting nothing. When Post message using Load runner, my ETL job is successfully picking it up. But for some reasons I am unable to use LR for testing. Please help me.

  60. I have downloaded all the jars required also eliminated few error but now I’m stuck at this, kindly assist me to solve this error this post has been very helpful

    Thread Name: JMS users 1-1
    Sample Start: 2017-06-01 12:41:24 IST
    Load time: 0
    Connect Time: 0
    Latency: 0
    Size in bytes: 0
    Sent bytes:0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Data type (“text”|”bin”|””): text
    Response code:
    Response message: java.lang.NullPointerException

    Response headers:

    SampleResult fields:
    ContentType:
    DataEncoding: null

  61. I have downloaded all the jars required also eliminated few error but now I’m stuck at this,

    Thread Name: JMS users 1-1
    Sample Start: 2017-06-01 12:41:24 IST
    Load time: 0
    Connect Time: 0
    Latency: 0
    Size in bytes: 0
    Sent bytes:0
    Headers size in bytes: 0
    Body size in bytes: 0
    Sample Count: 1
    Error Count: 1
    Data type (“text”|”bin”|””): text
    Response code:
    Response message: java.lang.NullPointerException

    kindly assist me to solve this error this post has been very helpful

  62. I can send a request to the queue but now I’ve to send a text file through JMS kindly assist what need to be changed in the JMS request.

Leave a Reply

Your email address will not be published.

*

© 2017 Technix

Theme by Anders NorénUp ↑