Javatpoint Logo
Javatpoint Logo

JMS Topic Test Plan

Now we will write a JMeter test plan to test a JMS Provider. For this test we have to create one subscriber and one publisher.

Create JMeter Test Plan

  • Go to your JMeter bin folder and double click on the ApacheJMeter.jar file to launch JMeter interface.
  • Click on the Test Plan node.
  • Rename this test plan node as JMS_topic_test.
  • Select the JMS_topic_test node and right click on the selected item.
  • Mouse hover on "Add" option, then elements list will be displayed.
  • Select Threads (Users) > Thread Group.
  • Rename this Thread Group element as JMS pub-sub user.
  • Change the loop count to two.
  • Rest of the default properties are left unaltered.

JMeter JMS Topic Test Plan

Adding JMS Subscriber and Publisher

  • Select the JMS pub-sub user element (Thread Group) and right click on the selected item.
  • Mouse hover on "Add" option, then elements list will be displayed.
  • Select Sampler > JMS Publisher.

JMeter JMS Topic Test Plan

Set up the following fields in the JMS Publisher sampler element:

  • Name - Sample Publisher
  • jndi.properties file - unchecked (JMeter uses the "JNDI Initial Context Factory" and "Provider URL" fields to create the connection)
  • Initial Context Factory - org.apache.activemq.jndi.Active MQ Initial Context Factory
  • Provider URL - tcp://localhost:61616
  • Connection Factory - Connection Factory
  • Destination - dynamic Topics/My Static Topic1
  • Number of samples to aggregate - 2 (Number of samples to aggregate)
  • Message source - Textarea
  • Message type - Text (The Message to use either for Text or Object message)
  • Remaining properties are left unaltered.

JMeter JMS Topic Test Plan

Now we will add a Subscriber.

  • Select the JMS pub-sub user element (Thread Group) and right click on the selected item.
  • Mouse hover on "Add" option, then elements list will be displayed.
  • Select Sampler > JMS Subscriber.

JMeter JMS Topic Test Plan

Set up the following fields in the JMS Subscriber sampler element:

  • Name - Sample Subscriber
  • jndi.properties file - unchecked (JMeter uses the "JNDI Initial Context Factory" and "Provider URL" fields to create the connection)
  • Initial Context Factory - org.apache.activemq.jndi.Active MQ Initial Context Factory
  • Provider URL - tcp://localhost:61616
  • Connection Factory - Connection Factory
  • Destination - dynamic Topics/My Static Topic1
  • Number of samples to aggregate - 2 (Number of samples to aggregate)
  • Store response - checked (The sampler should read the response. If not, only the response length is returned.)
  • Timeout - 2000
  • Remaining properties are left unaltered.

    • JMeter JMS Topic Test Plan

      Add Listener

      • Select the JMS pub-sub userelement.
      • Mouse hover on "Add" option, then elements list will be displayed.
      • Select Listener > View Results Tree option.

      JMeter JMS Topic Test Plan

      Save and Execute Test Plan

      • Click on File > Save Test Plan as.
      • Save the entire test plan as JMS_topic_test.jmx.

      • JMeter JMS Topic Test Plan
      • Click on Run > Start to execute the test plan.

      Verify the Output

      Output for Publisher:


      JMeter JMS Topic Test Plan
      JMeter JMS Topic Test Plan

      Output for Subscriber:


      JMeter JMS Topic Test Plan
      JMeter JMS Topic Test Plan

      You can see the message status in topics option of ActiveMQ admin console.


      JMeter JMS Topic Test Plan




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA