What is JMS (Java Messaging Service)?
JMS is an API used to establish messaging communication in between the software components or applications. It will be used to create/send/receive/read the messages from one entity to another entity or multiple entities. JMS playing a major role in any Enterprise Applications.
There are lot of JMS service providers available in the market as follows;
- Apache Active MQ
- Apache Qpid
- IBM MQ
- Amazon SQS’s
- HornetQ from JBoss
- OpenJMS
- Open Message Queue
- Oracle AQ
- RabbitMQ
In this post, we are going to see How to do load testing on IBM Websphere MQ from the above list of providers;
You can use Java Vuser protocol available in the Load Runner to load test the IBM Websphere MQ specific request cum response. I’ve used community edition of Load Runner v12.60 in this post and got 50 concurrent users as free license under community edition.
Our objective is to trigger the concurrent request to IBM MQ series and the other side transaction processing component is running to handle the MQ specific request processing with the appropriate business logic connected with the backend as illustrated below;
The above load testing workflow is application for any MQ series available in the market as stated in the JMS service providers section. In this post, tried with point to point (PTP) messaging domain under synchronous approach of each request should be receiving the expected response but reply queue part not enabled in the below view.
Build Transaction Request from flat file:
- Expected message format can be sent to Message Queue and it should be framed in a flat file or xml file or even hard coded in the String variable
- Use javax.xml.parsers.DocumentBuilderFactory object to load the xml file using the org.xml.sax.InputSource
- Store the xml file content to java.io.StringWriter object using javax.xml.transform.Transformer object and again store the final value into another String variable
- String variable value should be pushed to MQ under send message concept
Create Queue:
- Create an object using com.ibm.mq.jms.MQQueueConnectionFactory
- Set the pre-requisites using the above object based on the below parameters;
setTransportType
setQueueManager
setHostName
setPort
setChannel
- Create a MQ connection using com.ibm.mq.jms.MQQueueConnection and set the Queue username and password as parameters
- Create a Queue using com.ibm.mq.jms.MQQueue
Send Message:
- Create Sender object using com.ibm.mq.jms.MQQueueSender
- Create an object using javax.jms.TextMessage and pass the String Variable value as mentioned in the ‘Build Transaction Request from flat file:‘ part
- Start the connection
- Send the message using the Sender object
- Message should be successfully sent
The above stated client program should be appended inside the action() method associated with VuGen editor or eclipse editor.
- Map the required jar files in the classpath section of LoadRunner VuGen
- Compile the Script in the LoadRunner VuGen editor
- Run the script
- Ensure the transaction request reached MQ and Transaction processing component log
Go to LoadRunner Controller;
- Map the above VuGen Script in the Controller window
- Set the number of VUsers under Design section (Concurrent Users)
- Set the Duration (Time period)
- Set the ‘Stop the VUsers’ simultaneously or time interval
- Start the Scenario to perform load testing in which multiple number of concurrent request will be triggered to the IBM MQ using the Java client program integrated with LoadRunner Java VUser
- Once the execution completed, Go for Analysis to analyse the performance test report generated by LoadRunner
- Ensure the Transaction Processing Entity/Component capability through IMB MQ in which multiple number of request triggered from the LoadRunner controller
Thank you!