[
https://issues.apache.org/jira/browse/AMQ-7232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16866581#comment-16866581
]
Gary Tully commented on AMQ-7232:
---------------------------------
The outlier may be the topic enqueue count, dequeue count is only incremented
with a topic subscriber. For topics, enqueue/dequeue won't be consistent. In
the case of publishing to a topic with no consumers, the dequeue count gets out
of sync b/c it is dependent on the subs and the selectors.
maybe a way forward is to not do a topic send if there are virtual topics in
the mix. Ie: for cases where there are only virtual topic (queue) subs, it
could be consistent.
> Incorrect message counters when using virtual destinations
> ----------------------------------------------------------
>
> Key: AMQ-7232
> URL: https://issues.apache.org/jira/browse/AMQ-7232
> Project: ActiveMQ
> Issue Type: Bug
> Reporter: Lionel Cons
> Priority: Major
> Attachments: Virtual Destinations.jpg
>
>
> ActiveMQ supports [virtual
> destinations|https://activemq.apache.org/virtual-destinations] to magically
> link one or more queues to a topic.
> It also supports [JMX attributes|https://activemq.apache.org/jmx.html] to
> count messages going through the different destinations in a broker. There
> are both per-destination attributes ({{EnqueueCount}} and {{DequeueCount}})
> and per-broker attributes ({{TotalEnqueueCount}} and {{TotalDequeueCount}}).
> Unfortunately, these two features do not work well together.
> Take for instance the following scenario:
> * one topic ({{/topic/T}})
> * two virtual queues attached to it({{/queue/Consumer.A.T}} and
> {{/queue/Consumer.B.T}})
> * one topic producer ({{PT1}})
> * two queue consumers on each virtual queue ({{CA1}}, {{CA2}}, {{CB1}} and
> {{CB2}})
> !Virtual Destinations.jpg!
> When sending a single message, we get:
> * {{/topic/T}}: {{EnqueueCount += 1}} and {{DequeueCount += 0}}
> * {{/queue/Consumer.A.T}}: {{EnqueueCount += 1}} and {{DequeueCount += 1}}
> * {{/queue/Consumer.B.T}}: {{EnqueueCount += 1}} and {{DequeueCount += 1}}
> * at broker level: {{TotalEnqueueCount += 3}} and {{TotalDequeueCount += 2}}
> This is not consistent: when the message leaves the topic to go to the
> virtual queues, {{DequeueCount}} (on the topic) does not change while
> {{EnqueueCount}} (on the queues) does change.
> At broker level, {{TotalEnqueueCount}} gets incremented too much, giving the
> impression that 3 messages have been received.
> The main question is: should the counters be incremented when a message is
> magically forwarded from the topic to the attached virtual queues?
> I would argue that these counters should *not* change when messages move
> internally (i.e. along dashed lines). This way, we can continue to have
> {{TotalEnqueueCount}} being the sum of all {{EnqueueCount}} and at the same
> time representing the number of messages received (globally) by the broker.
> Idem for {{TotalDequeueCount}} and {{DequeueCount}}.
> IMHO, these counters should only change when messages move along solid lines.
> If we want to track the internals (i.e. dashed lines) then we should have an
> additional counter, a bit like we already have {{ForwardCount}} for network
> of brokers.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)