jmsactivemq-classicmessage-queuejms-topic

ActiveMQ topic starvation


I have one ActiveMQ 5.16 broker configured on Amazon and two topics, say topic1 and topic2, and I'm connecting using a JMS producer and consumer.

My question is if one of the topics is extremely high fidelity (like 10k messages/sec) and the other one is very very low fidelity one then how would the load balancing work in ActiveMQ? Will it result in one of the topics being starved? In other words, will topic1 publish get backed up and because of that will the topic2 consumer get messages delayed? In that case is it better to use two different queues with different brokers then?

To clarify, I don't have any actual data that indicates this is a real problem. I am just starting my implementation so this is more of a theoretical question.


Solution

  • There is no "load balancing" per se among different topics. It's essentially first come, first serve without any explicit coordination.

    Generally speaking, if you really care about performance you should probably be looking at ActiveMQ Artemis rather than ActiveMQ "Classic." ActiveMQ Artemis has a non-blocking architecture that scales much better under load. You're less likely to get into situations where threads are having to wait on each other.