Reputation: 369
I am looking for advisory messages for Artemis, like they exist in ActiveMQ x.5. I am using the core protocol, as I am using the core JMS Client.
What I actually want is to get notified when a queue has no consumers anymore for 10 minutes, for example.
I have only found something for the Apache ActiveMQ 5.x JMS client to enable/ disable those topics, but this does not change anything in the management console. Shouldn't I see there anything?
Can anyone explain how it is working here?
Upvotes: 0
Views: 988
Reputation: 34988
ActiveMQ Artemis does support ActiveMQ 5.x style advisory destinations and messages. However, since you're using the core protocol those won't help you because they are only available for OpenWire clients.
You may want to use management notifications. If so, you'd specifically want to pay attention to the notification messages whose _AMQ_NotifType
header is 2
(i.e. consumer created) and 3
(i.e. consumer closed). Both of these messages have a header named _AMQ_RoutingName
which indicate where the messages are routed (i.e. an address if you're using a JMS topic or a queue if you're using a JMS queue) and _AMQ_ConsumerCount
which indicate how many consumers exist there. You can use these notification messages to keep track of the consumers and then kick off timing processes to take action when certain thresholds elapse (e.g. 10 minutes with no consumers).
You could also use a metrics plugin and then something like Prometheus (using the Prometheus plugin) to manage alerts like this.
Upvotes: 2
Reputation: 2309
Apache ActiveMQ Artemis enables certain ActiveMQ Advisories, by default for the OpenWire protocol. The advisory addresses and queues created will be displayed on the management console, along with user deployed addresses and queues.
The supportAdvisory
parameter could be configured on an OpenWire acceptor to enable/disable advisories, ie:
<acceptor name="artemis">tcp://localhost:61616?protocols=OPENWIRE;supportAdvisory=true</acceptor>
The acceptor's parameters can be checked by the management console at http://localhost:8161/console/jmx/attributes?tab=artemis&nid=root-org.apache.activemq.artemis-%22<BROKER-NAME>%22-acceptors-<ACCEPTOR-NAME>
Upvotes: 1