JustNatural
JustNatural

Reputation: 448

How can the performance testing (and reporting) of Async messages over different IBM MQ queues be handled in Jmeter?

I need to test the performance of messages which are sent on one "inbound" MQ1 and then later (after some processing) received on another outbound MQ2. I need to somehow generate a report similar to Aggregate Report Listener in Jmeter to display the average "response time" or "processing time" (that is the time between when a message with a given unique ID was placed on an inbound queue and when a different message with the same unique id was consumed from a different outbound MQ) and the Throughput. I believe this falls into the Asynchronous category.

I have some Jmeter experience and limited scripting knowledge - I am hoping to use this tool to solve my problem using the inter-thread-communication-plugin-in-jmeter.

Inspired by the example and comments from this and this articles, my current high-level approach is to have a thread group controlling the insertion of messages on the inbound queue using the JSR223 Sampler with groovy code and another thread group controlling the consumption of messages from another outbound queue. I have set up the scripts to put and consume messages, but I am having difficulties in implementing the part with moving the information from one thread to the other and also to "conditionally" consume the message from the outbound queue only if it contains the unique message which I am looking for based on a variable generated by the 1st Thread group. If the message id is not found in 4 seconds I would like to throw an assertion and fail the sampler.

In Jmeter, in the Test Plan element I have defined a "message" variable. In the JSR223 Sampler I use vars.put("message", payload) to get the message content just before sending it to the Inbound queue (using producer.send(msg)) and then use it in Jmeter "Response Assertion" with "text message" selection and "Not Equals" just to execute this pattern ${__fifoPut(input_queue,${message})} which puts the message value to an FIFO "input_queue" (inter-thread-communication-plugin-in-jmeter).

Now, once I put this message in the FIFO queue, in the 2nd Tread that consumes the messages from the outbound queue I need some way to call ${__fifoPop(input_queue,${message})} in the script (and this does not work in the JSR223 Sampler) but only if the content of the message has the message Id that I am looking for in order to map the 1st message on queue1 with one of the messages from queue2. However in the script, I use consumer.receive(1000) method which directly consumes the message and thus removes it from the queue. Is there any way to just read messages from the queue without consuming them?

Problems summary:

  1. My first problem is to solve the synchronization issue of one message sent to MQ1 by thread1 with another message consumed from MQ2 by thread2.
  2. The 2nd problem is how to calculate the time difference between when a message was placed on MQ1 and when the corresponding same message was received/consumed on the MQ2.
  3. The 3rd problem is how to display this information in the same way as the Aggregate Report would in Jmeter. I would need to prove that a certain message was sent and received/consumed within x seconds under system load + calculate the Throughput in transactions per second.

Does anyone know how I could solve these issues?

Upvotes: 0

Views: 1090

Answers (1)

Dmitri T
Dmitri T

Reputation: 168122

  1. Why would you need the "synchronization" given you're testing an "asynchronous" system? If you want to ensure that you're reading the continuation of the initial message you can consider using JMS Correlation ID for this
  2. The IBM MQ testing with JMeter - Learn How (referenced by you, by the way) suggests using JMS_IBM_PUTDATE and JMS_IBM_PUTTIME properties to determine the timestamp for the "first" message
  3. Given you have timestamp delta between the current time and the time for the first message sending you can configure the JSR223 Sampler in 2nd Thread Group via SampleResult class instance so it would report not its own execution time but the delta between JMS_IBM_PUTTIME and the current time. Once done you can include into your load test report only this 2nd JSR223 Sampler

Upvotes: 1

Related Questions