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.
With the above setup, let us build the test plan for −