How to check latency with JMS PUB/SUB in Jmeter?
Created 2 samplers: JMS publisher and JMS Subscriber JMS Publisher send msgs on one queue and JMS subscriber listens msgs on another topic. How can I link these msgs to show latency??
AUT is multithreaded and order is not guaranteed on Topic.
You could save message ID or another unique message attribute into a JMeter Variable in the JMS Publisher along with the current timestamp
Whenever the message arrives to the JMS Subscriber you can check the attribute from the step 1 and obtain the timestamp at the time of sending. Then you can subtract the timestamp2 from the timestamp1 and the resulting value would be the "latency" you're looking for.
JMeter Functions you might be interested in:
- __time() - gets current time in Unix timestamp format and stores it into a JMeter Variable with the given name
- __longSum() - sums given numbers (or subtracts if one of them is negative) and stores the result into a JMeter Variable