Create two thread groups and groups per iteration to 10. Total message Thread (6) x (1 message) (repeat 10 times) = 60 message. To establish a test plan, you will use the following elements: thread Groups , JMS Publishers , JMS users , and graph results .
General Note JMS: There are currently two JMS samples. One uses a JMS topic and another uses a queue. A topic is often referred to as a message for publish/subscribe messaging. The subject message is usually used in this case, where the message is produced by the producer and published by multiple subscribers. Queue messages are typically used for the transaction sender to expect a response. The messaging system has a large variety of normal HTTP requests. In HTTP, a single user sends a request and gets a response. Information systems can work in both synchronous and asynchronous modes. The JMS sampler requires a JMS-implemented jar file, for example, Apache ActiveMQ. See the jar provided in the activemq list here.
Add User
The first step is to add a Thread Group element. The thread group tells JMeter the number of users you want to simulate, how long users should send requests, and how much they should send.
continue adding Threadgroup elements first select the test plan, click your right mouse button Add a menu, then choose add a?? threadgroup .
You should now see the thread group elements under the test plan. If you don't see the elements, then "enlarge" the test plan by clicking on the elements of the planning tree test plan.
Next, you need to modify the default properties. Select the thread group element on the tree, if you have not selected it yet. You should now see the thread jmeter the Group Control Panel in the correct part of the window (see Figure 12.1)
Figure 12.1. Default values for thread groups
first, provide a more descriptive name for our thread group. In the Name field, enter the user .
Next, increase the number of users (called threads) 5 .
0  seconds. This property tells JMeter how long to start the delay between each user. For example, if you enter a 5-second transition period, JMeter will complete all your users starting at 5 seconds before the end of the year. So if we have 5 users and a 5 second transition, then the delay between users will be 1 seconds (5 users/5 seconds = 1 users per second). If you set the value to 0,jmeter, all users will start immediately.
clear check box marked "  forever " and enter a value 10  0 forever check box.
Repeat this process to add another thread group. For the second thread group, enter " publisher in the Name field, set the number of threads to 1 , and set the iteration to ten ."
In most applications, you must manually accept the changes you made in a control panel. However, in JMeter, control Panel you let them automatically accept your changes. If you change the name of an element, this tree will be updated with the new text in the control Panel (for example, when selecting another tree element). add JMS Users and Publishers
ensure that the required jar files are in the JMeter the free directory. If they are jmeter shut down, restart JMeter to copy the jar file.
start by adding sampler JMS user user element ( add one?? sampler one?? JMS user ). Then, select the elements in the JMS user tree and edit the following properties:
- Change the Name field to " Sample User "
- If the JMS provider uses jndi.properties file, select the check box
- Enter a name for the Initialcontextfactory class. For example, using ACTIVEMQ 5.4, the value is "org.apache.activemq.jndi.ActiveMQInitialContextFactory "
- Enter the provider URL. This is the URL of the Jndi server, if any. For example, using the default port on the local machine using ACTIVEMQ 5.4, the value is " tcp://localhost:61616 "
- Enter the name of the connection factory. Please refer to the documentation for JMS provider information. ActiveMQ, default is " connectionfactory "
- Enter a name for the subject of the message. ACTIVEMQ Dynamic Theme (dynamically creating themes), the value is " dynamictopics/mystatictopic1 " Note: Setting at startup means that JMeter starts listening to the target without a name change that may be at the beginning of the test. Set the last option to allow the destination name to be some jmeter variable before each sample mean JMeter (re) starts running each JMS user sample
- If the JMS provider requires authentication, check the " Request , enter the user name and password. For example, Orion JMS requires authentication, while ACTIVEMQ and MQSeries do not
- input in the " Total quantity of samples ". For performance reasons, the sampler aggregates information because the small messages will arrive soon. If the sampler does not have an aggregated message, jmeter cannot keep up.
- If you want to read the response, check box
- There are two client implementations of the user. If the JMS provider exhibits a zombie thread and a client, try another.
Figure 12.2. JMS User
next add sampler JMS publisher publisher Element (  add one?? sampler one?? JMS user ). Then, select the JMS publisher element on the tree and edit the following properties:
- Change the Name field to " The publisher of the sample . "
- If the JMS provider uses jndi.properties file, select the check box
- Enter a name for the Initialcontextfactory class. For example, using ACTIVEMQ 5.4, the value is "org.apache.activemq.jndi.ActiveMQInitialContextFactory "
- Enter the provider URL. This is the URL of the Jndi server, if any. For example, using the default port on the local machine using ACTIVEMQ 5.4, the value is " tcp://localhost:61616 "
- Enter the name of the connection factory. Please refer to the documentation for JMS provider information. ActiveMQ, default is " connectionfactory "
- Enter a name for the subject of the message. ACTIVEMQ Dynamic Theme (dynamically creating a theme), the value is " dynamictopics/mystatictopic1 ". Note: Setting at startup means that JMeter starts with a destination without a name change that may be at the beginning of the test. Set at each sample mean value JMeter (re) Start connection before running each JMS Publisher sample, the last option allows the destination name to have some jmeter variable
- If the JMS provider requires authentication, check the " Request , enter the user name and password. For example, Orion JMS requires authentication, while ACTIVEMQ and MQSeries do not
- input in the " Total quantity of samples ". For performance reasons, the sampler aggregates information because the small messages will arrive soon. If the sampler does not have an aggregated message, jmeter cannot keep up.
- Select the appropriate configuration message to publish. If you want the sampler to randomly select a message, place the message in a directory using browse and select the directory.
- Select the message type. If the message is in object format or map information, make sure that the message is generated correctly.
Figure 12.3. The publisher of JMSAdd a listener to view storage test results
The last element is one that needs to be added to your test plan Listener . This element is the visual model that is responsible for storing the results of all HTTP requests in a file and presenting the data.
Select a test plan and add an element Listener ( add one?? listener one?? graph results ). Next, you need to specify a directory and file name output file. You can go to the File Name field type, or select the Browse button, browse to a directory, and enter a file name.
Figure 12.4. Graph result Listener
JMeter set up a JMS topic test plan