Table of contents
1.
Introduction
2.
About JMS 
3.
JMS Test Plan in JMeter
3.1.
Point-to-Point messaging 
3.2.
Topic messaging 
4.
Frequently Asked Questions
4.1.
What does the slash signify while entering the path?
4.2.
Is the JMeter tool capable of simulating a real browser?
4.3.
Describe how JMeter works internally.
4.4.
What is the purpose of the Timer in JMeter?
4.5.
Does JMeter require coding?
5.
Conclusion
Last Updated: Mar 27, 2024
Easy

Introduction to JMS Test Plan in JMeter

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Let’s say we have the requirement that we need to test a web server and check how many concurrent users can it handle? For that, we need a performance testing tool which generates and simulates a large number of concurrent user load on the web server. So are you also thinking that Apache Jmeter will be the suitable tool? Then yes this is where Apache Jmeter comes for rescue!

It is an open-source load and performance testing software based on Java Language. It was primarily written to load and test the performance of Apache JServ (also called the Apache Tomcat project). Later on, to add more features and functional testing capabilities, the Apache community redesigned it to enhance the GUI. 

Introduction to JMS test Plan in JMeter

As we know, messaging is a process to communicate applications or software components. JMS is also one of those techniques, mainly used to send and receive messages from one application to another. This article will outline how to create a JMS test Plan in JMeter for the testing of JMS Providers.

About JMS 

JMS stands for Java Messaging Service. It is an API that provides the facility to read, create and send messages. This messaging service provides loosely coupled, reliable and asynchronous communication. Generally, the user sends a message to the application. But, to send messages from one app to another, we need to use JMS API. In JMS, the client is not required to send the request to receive messages. The message will arrive automatically to the client.

Consider an example of application X, which is running in India, and another application Y is running in Singapore. To send a message from A application to B, we need to use JMS.

There are various JMS servers like Tibco, IBM WebSphere MQ, glassfish3, etc. For our test purpose, we will use Apache ActiveMQ. Now let’s discuss the process of creating JMS test Plan in JMeter.

JMS Test Plan in JMeter

Before writing a simple test plan to test JMS(Java Messaging Service ), you need to install Apache ActiveMQ on your system. Once it is downloaded, to start the ActiveMQ server, run-

.\bin\activemq  start

Click on this link to verify whether the ActiveMQ server has started. This http://localhost:8161/admin/ link will redirect you to its authentication page, where it will ask for the User Name and Password. Enter 'admin' as the User Name and password. 

Once you enter the authentication details correctly, the given image will appear as the default interface of the ActiveMQ server.

ActiveMQ

Now, copy the "activemq-all-5.17.2.jar" file from the activemq-5.17.2 folder to the C:\JMeter\apache-jmeter-3.0\lib folder.

JMS test Plan in JMeter that tests Java Messaging Service, generally supports two types of messaging−

Point-to-Point messaging 

Queue messaging is generally used for transactions when the sender expects a response from the receiver. Here the messaging systems are quite different from any HTTP requests. In HTTP, a single user is used to send a request and gets a response. 

Now to create JMeter Test Plan, follow the given steps-

Step.1: Launch the JMeter interface by clicking on the ApacheJMeter.jar file in your JMeter bin folder.

jmeter window batch

Step 2: Rename this test plan node as JMSpoint_to_point.

Step 3: Now right-click on the JMSpoint_to_point test plan and Thread Group by following these steps-

adding thread group

Step 4: Rename the selected Thread Group element as JMS user and change the loop count to two.

thread group element

Rest of the default properties are left unaltered.

Step 5: Now add the JMS Point-to-Point Sampler to JMS user element by following the given steps-

Point-to-Point Sampler

Step 6: Now fill the JMS Point-to-point sampler element as follows-

  • JNDI name Request queue: Q.REQ
  • JNDI name Receive queue: Q.REQ

Step 7: After filling these details in JMS test plan, add View Results Tree listener to the port to view result by following these simple steps-

adding listener

Step 8: Now save the test plan as JMS Point-to-Point.jmx and execute the test plan by clicking on run( â–¶) button.

Point-to-Point test

Now output will be visible in the listener-

Topic messaging 

Topic messages are also known as pub/sub messaging. These pub/sub messaging are generally used when the message is published by a producer and then consumed by the multiple subscribers. 

Step1: Create JMeter Test Plan and rename as JMS_topic_test.

Step 2: Right-click on JMS_topic_test, add the thread group and rename it as JMS pub-sub user.

adding thread group

Step 3: Right Click on the Thread Group element and add sampler then click on JMS Subscriber and Publisher.

adding and renaming thread group

Now fill details as per the given image-

adding sampler

Step 4: The next step is to add a Subscriber.

adding sampler

Now fill the details of JMS Subscriber as shown in given image-

JMS subscriber

Step 5: Add the view results tree listener.

view results tree listener

Step 6: Save and Execute Test Plan

view results tree

Verify the Output by clicking on the ‘Run’ button on the menu bar. Now you can see the result in tree format by clicking on the start button.

run option

In the ActiveMQ admin console's topics option, you can view the message status.

 ActiveMQ

This was all about JMS test Plan in JMeter, now it’s time for some frequently asked questions on JMS test Plan in JMeter.

Must Read Apache Server

Frequently Asked Questions

What does the slash signify while entering the path?

Writing Path as "/" (slash) suggests that we want the root page of the server.

Is the JMeter tool capable of simulating a real browser?

No, JMeter does not replicate or operate the same way as a genuine browser. It cannot render HTML responses as a real browser can.

Describe how JMeter works internally.

JMeter creates numerous threads that make simultaneous requests to a target server to simulate real-world user load. The server's performance is then displayed via tables and graphs.

What is the purpose of the Timer in JMeter?

JMeter can use a timer to delay the time between each request a thread makes. It is capable of resolving the server's overload issue.

Does JMeter require coding?

No, it does not require coding skills. If any script has to be created, that can be done using an inbuilt recorder.

Conclusion

JMS is a technique to send and receive messages from one application to another. This article discusses the JMS test Plan in JMeter which generally supports two types of messaging point-to-point and topic messaging.

To explore more on JMeter, here are more articles for rescue. 

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enroll in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.

Happy Coding!

Live masterclass