jMeter JMS | jMeter - JMS Test Plan - jmeter - jmeter tutorial
What is jMeter JMS?
- General notes on JMS: There are currently two JMS samplers. One uses JMS topics and the other uses queues. Topic messages are commonly known as pub/sub messaging.
- Topic messaging is generally used in cases where a message is published by a producer and consumed by multiple subscribers.
- Queue messaging is generally used for transactions where the sender expects a response. Messaging systems are quite different from normal HTTP requests.
- In HTTP, a single user sends a request and gets a response. Messaging system can work in synchronous and asynchronous mode.
learn apache jmeter tutorials - java messaging services Example
In this chapter, we will learn how to write a simple test plan to test Java Messaging Service (JMS). JMS supports two types of messaging
Point-to-Point messaging
- Queue messaging is generally used for transactions where the sender expects a response.
- Messaging systems are quite different from normal HTTP requests. In HTTP, a single user sends a request and gets a response.
Topic messaging
- Topic messages are commonly known as pub/sub messaging. Topic messaging is generally used in cases where a message is published by a producer and consumed by multiple subscribers.
Let us see a test example for each of these. The pre-requisites for testing JMS are
- We use Apache ActiveMQ in the example. There are various JMS servers like IBM WebSphere MQ (formerly MQSeries), Tibco, etc. Download it from the binaries from the Apache ActiveMQ website.
- Unzip the archive, go to the decompressed directory, and run the following command from the command console to start the ActiveMQ server −
- .\bin\activemq start
- You can verify if the ActiveMQ server has started by visiting the admin interface at the following address http://localhost:8161/admin/.
- If it asks for authentication, then enter the userid and password as admin. The screen is similar as shown below
- Now copy the activemq-all-x.x.x.jar (XXX depending on the version) from the ActiveMQ unzipped directory to /home/manisha/apache-jmeter-2.9/lib.
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter
Building a JMS Point-to-Point Test Plan
- Now let us write a JMeter test plan to test a JMS Point-to-Point messaging solution. The setup of the test is one thread group with one thread or user sending 2 messages each through a request queue.
- Let us start the JMeter from /home/manisha/apache-jmeter2.9/bin/jmeter.sh.
Add Users
- Create a Thread group.
- Right-click the Test Plan node.
- Select Add > Threads (Users) > Thread Group. Thread Group gets added under the Test Plan node.
- Rename this Thread Group as JMSTestPlan-PointtoPoint.
- We will change the Loop Count to two. Rest of the default properties of the Thread Group are retained.
- It means one thread group with one thread or one user sends two messages each through a request queue.
Add JMS Point-to-Point Sampler
- Now that we have defined the 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.
- Select Add > Sampler > JMS Point-to-Point.
- 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
Building a JMS Topic Test Plan
- Now let us write a JMeter test plan to test a JMS Provider. We will create one subscriber and one publisher. We will create one thread group and set each one to two iterations
- First let us start the JMeter from /home/manisha/apache-jmeter2.9/bin/jmeter.sh.
Add Users
Now create a Thread group as follows
- Right-click the Test Plan
- Select Add > Threads (Users) > Thread Group. Thread Group will get added under the Test Plan node.
- Rename this Thread Group as JMS pub-sub user.
- We will change the Loop Count to two. Rest of the default properties of the Thread Group are retained.
- It means one thread group with one thread or one user sends two messages each through a request queue.