Package org.apache.activemq.advisory
Class ConsumerEventSource
java.lang.Object
org.apache.activemq.advisory.ConsumerEventSource
- All Implemented Interfaces:
jakarta.jms.MessageListener,Service
An object which can be used to listen to the number of active consumers
available on a given destination.
-
Constructor Summary
ConstructorsConstructorDescriptionConsumerEventSource(jakarta.jms.Connection connection, jakarta.jms.Destination destination) -
Method Summary
Modifier and TypeMethodDescriptionprotected intextractConsumerCountFromMessage(jakarta.jms.Message message, int count) Lets rely by default on the broker telling us what the consumer count is as it can ensure that we are up to date at all times and have not received messages out of order etc.protected voidfireConsumerEvent(ConsumerEvent event) voidonMessage(jakarta.jms.Message message) voidsetConsumerListener(ConsumerListener listener) voidstart()voidstop()
-
Constructor Details
-
ConsumerEventSource
public ConsumerEventSource(jakarta.jms.Connection connection, jakarta.jms.Destination destination) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
-
Method Details
-
setConsumerListener
-
getConsumerId
-
start
-
stop
-
onMessage
public void onMessage(jakarta.jms.Message message) - Specified by:
onMessagein interfacejakarta.jms.MessageListener
-
extractConsumerCountFromMessage
protected int extractConsumerCountFromMessage(jakarta.jms.Message message, int count) Lets rely by default on the broker telling us what the consumer count is as it can ensure that we are up to date at all times and have not received messages out of order etc. -
fireConsumerEvent
-