I’m working on a Java-based messaging platform with microservices and using ActiveMQ’s virtual topic implementation. There’s a single topic, and multiple services use it to publish/subscribe to messages or events.
During load testing, I noticed that one of the consumers was significantly slower than the others. In the ActiveMQ console, I observed that the “Number of Pending Messages” keeps increasing for this particular consumer.
Details:
ActiveMQ Configurations: Identical across all consumers.
Processing Time:
The consumer’s processing time after receiving a message from the broker is between 20-50 milliseconds, which seems acceptable.
Delay Measurement:
I added a timestamp when the message is published and compared it with the time it was received by the consumer. The delay is approximately 40 seconds, which is much higher than expected and likely the reason for the message backlog.
Given that the configurations and connection logic are consistent across consumers, I’m puzzled by this delay.
Question:
What could be causing this delay for this specific consumer, and how can I resolve the issue to prevent messages from piling up in the “Number of Pending Messages” section?