Do you think IIT Guwahati certified course can help you in your career?
No
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.
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' asthe User Name and password.
Once you enter the authentication details correctly, the given image will appear as the default interface of the ActiveMQ server.
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.
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-
Step 4: Rename the selected Thread Group element as JMS user and change the loop count to two.
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-
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-
Step 8: Now save the test plan as JMS Point-to-Point.jmx and execute the test plan by clicking on run( â–¶) button.
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.
Step 3: Right Click on the Thread Group element and add sampler then click on JMS Subscriber and Publisher.
Now fill details as per the given image-
Step 4: The next step is to add a Subscriber.
Now fill the details of JMS Subscriber as shown in given image-
Step 5: Add the view results tree listener.
Step 6: Save and Execute Test Plan
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.
In the ActiveMQ admin console's topics option, you can view the message status.
This was all about JMS test Plan in JMeter, now it’s time for some frequently asked questions on JMS test Plan in JMeter.
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.