jMeter - JMS Point To Point Test Plan
Building a JMS Point-to-Point Test Plan
Now let's write a JMeter test plan to test a JMS Point-to-Point messaging solution. The setup of the test is 1 threadgroup with 1 thread or user sending 2 messages each through a request queue.
First let's start the JMeter from /home/manisha/apache-jmeter-2.9/bin/jmeter.sh.
Now create a Thread group, right click on Test Plan > Add> Threads(Users)> Thread Group. Thread Group will get added under the Test Plan node. Rename this Thread Group as JMSTestPlan-PointtoPoint.
We will change the Loop Count to 2. Rest of the default properties of the Thread Group are retained. This means that 1 threadgroup with 1 thread or user sends 2 messages each through a request queue.
Adding JMS Point-to-Point Sampler
Now that we have defined our users, it is time to define the tasks that they will be performing. Start by adding the sampler JMS Point-to-Point to the Point-to-Point element (Add > Sampler > JMS Point-to-Point). Then, select the JMS Point-to-Point sampler element in the tree. The following property changes are made to the JMS Point-to-Point sampler element:
|QueueuConnectionFactory||ConnectionFactory||This is the default JNDI entry for the connection factory within active mq.|
|JNDI Name Request Queue||Q.REQ||The JNDI name for JMeter to make the connection between the connection factory and queue.|
|JNDI Name Receive Queue||Q.REQ||The JNDI name for JMeter to make the connection between the connection factory and queue. We are using the same queue for response.|
|Communication Style||Request Response||This means that you need at least a service running outside of JMeter and that will respond to the requests. This service must listen to the Request Queue and send messages to the queue referenced by the message.getJMSReplyTo()|
|Use Request message ID||checked||You can leave JMeter to use the message ID Request (deposit) to the correlation between the incoming message and recovered.|
|Use Response message ID||checked||You can leave JMeter use the message identifier Response (recovery) for the correlation between the incoming message and recovered.|
|Time(milliseconds)||2000||This timeout is used when the message is received by JMeter if nothing is recovered in time (here 2 sec), then the item will be marked in error.|
|Content||Testing point to point||This is just the content of the message.|
|The standard InitialContextFactory for Active MQ|
|queue.Q.REQ||example.A||Correspondence between the JNDI name of the queue (Q.REQ) and the real name of the queue in ActiveMQ (example.A).|
|Provider URL||tcp://localhost:61616||The address and port to attack ActiveMQ.|
The screen shot below shows above configurations:
Now add the Listener element. This element is responsible for storing all of the results of your JMS requests in a file and presenting a visual model of the data.
Select the Thread Group element and add a View Results Tree listener (Add > Listener > View Results Tree).
Save and Execute Test Plan
Now save the above test plan as jmsptp_test.jmx. Execute this test plan using Run > Start option.
Return to the admin console of ActiveMQ, from this we can see message status in the queue.