Class ProducerEventSource

java.lang.Object
org.apache.activemq.advisory.ProducerEventSource
All Implemented Interfaces:
jakarta.jms.MessageListener, Service

public class ProducerEventSource extends Object implements Service, jakarta.jms.MessageListener
An object which can be used to listen to the number of active consumers available on a given destination.
  • Constructor Details

    • ProducerEventSource

      public ProducerEventSource(jakarta.jms.Connection connection, jakarta.jms.Destination destination) throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
  • Method Details

    • setProducerListener

      public void setProducerListener(ProducerListener listener)
    • start

      public void start() throws Exception
      Specified by:
      start in interface Service
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface Service
      Throws:
      Exception
    • onMessage

      public void onMessage(jakarta.jms.Message message)
      Specified by:
      onMessage in interface jakarta.jms.MessageListener
    • extractProducerCountFromMessage

      protected int extractProducerCountFromMessage(jakarta.jms.Message message, int count)
    • fireProducerEvent

      protected void fireProducerEvent(ProducerEvent event)