Apache ActiveMQ is a Java-based message broker that processes incoming messages from applications and communicates them across your infrastructure. Message buses, like ActiveMQ, are middleware that enable easy integration across applications and systems for effective communication across every component in your stack. The broker routes, transforms, validates, and translates messages from distributed processes into the appropriate format to minimize the work needed to keep disparate systems connected and communicating.
With Datadog, you can monitor ActiveMQ metrics along with all of your other infrastructure metrics in one easy-to-use dashboard, giving you an in-depth look into how your systems and services are communicating and performing.
Datadog’s ActiveMQ integration lets you correlate your queue and broker performance with the rest of your infrastructure, providing invaluable context when troubleshooting diminished or deteriorated message transmission. The Datadog Agent automatically collects your ActiveMQ data using a JMX connection and visualizes queue, broker, and system metrics all in one place.
Besides basic resource metrics like the number of active consumers and producers, the ActiveMQ dashboard exposes critical metrics that inform your ActiveMQ performance. Among these critical metrics, monitoring memory usage of your broker is one of the most important actions you can take to ensure proper ActiveMQ operation.
Memory consumption by queue and broker host memory usage will typically spike when a broker is inundated with producers’ messages, however, large usage spikes can be a cause for concern. Unexpected spikes in memory consumption can be a symptom of overly large message payloads or too many messages being sent and processed at once. Depleted memory can slow down the transmission of messages or even stop their transmission altogether, depending on the severity of the spike.
Other key metrics to keep in mind when monitoring ActiveMQ performance include queue size, and enqueue, dequeue, and expired counts. Enqueue count refers to the number of messages enqueued since the last reset—this metric increases monotonically over time as more messages are enqueued. In Datadog, enqueue count is visualized as a rate (enqueues/sec) and should match your dequeue count rate if your producer and active consumers are synced.
Dequeued count rate displays the number of messages removed from the queue and dispatched. If your dequeued message rate changes drastically, take a look at the queue size to see if it is elevated. If queue size is elevated, then messages are not being dequeued for dispatch to consumers.
Dispatched count rate shows the number of messages that have been sent to consumers. For queues, dispatch count rate should approximate enqueued and dequeued rates for efficient dispatch to consumers. This can be confirmed by observing the expired rate and the inflight rate.
Datadog also helps you keep track of your ActiveMQ topics and their consumers, including subscribers. Topic metrics exposed through Datadog give you an understanding of how many topics exist within your broker, the number of consumers per topic, and their enqueue and dequeue rates.
You can start monitoring the most important subscriber metrics from the out-of-the-box ActiveMQ screenboard, including count and queue metrics. The subscriber count is helpful for understanding how many subscribers are currently listening to your topics and provide context for the subscriber queue metrics.
In the case that subscriber queue sizes vary wildly, you can take a look at the topic tags and correlate subscriber metrics with their respective topic metrics to diagnose the issue.
Datadog makes it easy to become familiar with the inner workings of your ActiveMQ broker by automatically collecting your performance metrics. If you’re already a Datadog customer, you can start monitoring your ActiveMQ metrics by following our setup documentation. Otherwise, if you’d like to optimize and troubleshoot your ActiveMQ performance, you can sign up for a free trial and get started today. If you’re using a different broker to increase your system connectivity, like Apache Kafka, we’ve also got you covered!