[
https://issues.apache.org/jira/browse/ARTEMIS-4915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876894#comment-17876894
]
Justin Bertram commented on ARTEMIS-4915:
-----------------------------------------
I think this is actually working as designed. Generally speaking, the broker
doesn't maintain historical data about queues, addresses, etc. The only
exception is [message
counters|https://activemq.apache.org/components/artemis/documentation/latest/management.html#message-counters].
However, message counters are an old implementation and these days we
recommend using a [metrics
plugin|https://activemq.apache.org/components/artemis/documentation/latest/metrics.html#metrics]
to integrate with an external metrics monitoring system like Prometheus. The
metrics monitoring system can collect metrics from the broker over time not
just for real-time monitoring but for later retrieval and analysis, alerting,
visualization, etc.
That said, the descriptions of broker metrics like "Total Messages Added" and
"Total Messages Acknowledged" is misleading and should be clarified. I'll use
this Jira for that work.
> TotalMessagesAdded/Acknowledged metrics are inaccurate if queues deleted
> ------------------------------------------------------------------------
>
> Key: ARTEMIS-4915
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4915
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: JMX, management
> Reporter: Josh Byster
> Priority: Minor
>
> Currently, the total messages added/acknowledged fields are computed by
> summing up the counts on the individual queues, i.e.
> {code:java}
> @Override
> public long getTotalMessagesAdded() {
> long total = 0;
> for (Binding binding : iterableOf(postOffice.getAllBindings())) {
> if (binding.getType() == BindingType.LOCAL_QUEUE) {
> total += ((LocalQueueBinding)
> binding).getQueue().getMessagesAdded();
> }
> }
> return total;
> }
> {code}
> This fails to give an accurate count if queues are being created or deleted
> (for example, as consumers disconnect or reconnect).
> This can easily be demonstrated by sending messages and then disconnecting
> all consumers (with queue auto-deletion) and seeing the "messages added"
> count drop to 0.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact