0
votes

We are upgrading an application to use ActiveMQ (classic, version 5.15.9). Hence, we are aligning our existing JMeter (version 3.1) tests to use ActiveMQ. In the JMS Sampler, the properties have been modified and set as follow:

  • Initial Context Factory = org.apache.activemq.jndi.ActiveMQInitialContextFactory
  • Context Provider Url = tcp://[MyHost]:61616
  • Queue Connection Factory = ConnectionFactory
  • Send Queue = queue.MyApp.RequestQueue
  • Receive Queue = queue.MyApp.ResponseQueue

Still, I get the following error in the JMeter logs (even though functional tests work with that ActiveMQ stand-alone and queues):

ERROR - jmeter.protocol.jms.sampler.JMSSampler: queue.MyApp.RequestQueue javax.naming.NameNotFoundException: queue.MyApp.RequestQueue

at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:235)

at javax.naming.InitialContext.lookup(InitialContext.java:417)

at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:337)

at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:659)

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:628)

at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:616)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:245)

at java.lang.Thread.run(Thread.java:745)

Any thought on what I may have missed?

2

2 Answers

1
votes

You need to configure JMS Point-to-Point Sampler a little bit differently, to wit:

  1. JNDI name Request queue: Q.REQ
  2. JNDI name Receive queue: Q.RSP
  3. Add the following JNDI properties:

    • queue.Q.RSP with the value of queue.MyApp.ResponseQueue
    • queue.Q.REQ with the value of queue.MyApp.RequestQueue

Full configuration just in case:

enter image description here

More information: Building a JMS Testing Plan - Apache JMeter

Demo:

enter image description here

0
votes

I got looking to https://www.tutorialspoint.com/jmeter/jmeter_jms_pointtopoint_test_plan.htm to find the solution to my issue.

As in this tutorial, I set:

  • Send Queue = Q.REQ
  • Receive Queue = Q.RESP

Then, I added JNDI Properties as follow:

  • Name = queue.Q.REQ, value = queue.MyApp.RequestQueue
  • Name = queue.Q.RESP, value = queue.MyApp.RequestQueue

And Voila!