I have a remote IBM MQ instance set up with 2 queues. Behind them is a System Under Test which always picks up messages put on the INBOUND.QUEUE" does some processing and places a response message on the "OUTBOUND.QUEUE".
I wish to test the response times of this SuT. To achieve this I need to put in place this scenario:
In JMeter I have a setup very similar to the one described in this article, using JSR223 test elements with groovy code to interact with the IBM MQ Queues - through JMS, if my understanding is correct. The difference from the article is that in order to consume messages from the outbound queue, I have another setUp Thread Group which sets up another connection for the "OUTBOUND.QUEUE" from which I consume the messages and another tearDown Thread Group which closes this connection at the end.
On a high-level my setup looks like this:
It works so far, but it blindly consumes messages and I need to ensure that I'm reading (consuming) the response continuation of each initial message so that I may calculate the response or processing time of the SuT for each complete request-response flow. I understood that I can use JMS Correlation ID for this purpose but I don't know how.
What method can I use to get this Correlation ID at message creation and consumption time?
Do I need some data structure to put all the Correlation IDs at the message creation time so that I can put a condition like IF msg.getStringProperty("JMS_CorreationID") is IN list of produced ids, remove it from this data structure, then get the JMS_IBM_PUTTIME property to determine the timestamp for the "first" message, then finally calculate the timestamp delta between the current time and the time for the first message ?
Once I would do this, how can I configure the JSR223 Sampler (Consumer) in the 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 (which would represent the processing time)?
Finally, once this is done, how can I include into the load test report only this 2nd JSR223 Sampler (Consumer)?
Is this logic correct/too complex? Any help or some code examples would be greatly appreciated.
Normally you're supposed to be asking only one question in one post, I don't think anyone is willing to write a book to answer all the questions you have (and doing your job for you for free)
props
shorthand for JMeter Properties class instanceprev.elapsedTime = 123456
, replace 123456
with the actual delta between sent and received message with the given correlation IDSampleResult.setIgnore()
function, this way the JSR223 Sampler where you call this function will neither be displayed in Listeners nor in .jtl results file.