Class SubscriptionView

java.lang.Object
org.apache.activemq.broker.jmx.SubscriptionView
All Implemented Interfaces:
SubscriptionViewMBean
Direct Known Subclasses:
DurableSubscriptionView, TopicSubscriptionView

public class SubscriptionView extends Object implements SubscriptionViewMBean
  • Field Details

    • subscription

      protected final Subscription subscription
    • clientId

      protected final String clientId
    • userName

      protected final String userName
  • Constructor Details

    • SubscriptionView

      public SubscriptionView(String clientId, String userName, Subscription subs)
      Constructor
      Parameters:
      subs -
  • Method Details

    • getClientId

      public String getClientId()
      Specified by:
      getClientId in interface SubscriptionViewMBean
      Returns:
      the clientId
    • getConnection

      public ObjectName getConnection()
      Description copied from interface: SubscriptionViewMBean
      Returns the ObjectName of the Connection that created this Subscription. This value can be null if for instance this is an off-line durable subscription.
      Specified by:
      getConnection in interface SubscriptionViewMBean
      Returns:
      the name of the Connection that created this Subscription.
    • getConnectionId

      public String getConnectionId()
      Specified by:
      getConnectionId in interface SubscriptionViewMBean
      Returns:
      the id of the Connection the Subscription is on
    • getSessionId

      public long getSessionId()
      Specified by:
      getSessionId in interface SubscriptionViewMBean
      Returns:
      the id of the Session the subscription is on
    • getSubscriptionId

      public long getSubscriptionId()
      Specified by:
      getSubscriptionId in interface SubscriptionViewMBean
      Returns:
      the id of the Subscription
    • getDestinationName

      public String getDestinationName()
      Specified by:
      getDestinationName in interface SubscriptionViewMBean
      Returns:
      the destination name
    • getSelector

      public String getSelector()
      Specified by:
      getSelector in interface SubscriptionViewMBean
      Returns:
      the JMS selector on the current subscription
    • setSelector

      public void setSelector(String selector) throws jakarta.jms.InvalidSelectorException, UnsupportedOperationException
      Description copied from interface: SubscriptionViewMBean
      Attempts to change the current active selector on the subscription. This operation is not supported for persistent topics.
      Specified by:
      setSelector in interface SubscriptionViewMBean
      Throws:
      jakarta.jms.InvalidSelectorException
      UnsupportedOperationException
    • isDestinationQueue

      public boolean isDestinationQueue()
      Specified by:
      isDestinationQueue in interface SubscriptionViewMBean
      Returns:
      true if the destination is a Queue
    • isDestinationTopic

      public boolean isDestinationTopic()
      Specified by:
      isDestinationTopic in interface SubscriptionViewMBean
      Returns:
      true of the destination is a Topic
    • isDestinationTemporary

      public boolean isDestinationTemporary()
      Specified by:
      isDestinationTemporary in interface SubscriptionViewMBean
      Returns:
      true if the destination is temporary
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface SubscriptionViewMBean
      Returns:
      true if the subscriber is active
    • isNetwork

      public boolean isNetwork()
      Specified by:
      isNetwork in interface SubscriptionViewMBean
    • gc

      public void gc()
      The subscription should release as may references as it can to help the garbage collector reclaim memory.
    • isRetroactive

      public boolean isRetroactive()
      Specified by:
      isRetroactive in interface SubscriptionViewMBean
      Returns:
      whether or not the subscriber is retroactive or not
    • isExclusive

      public boolean isExclusive()
      Specified by:
      isExclusive in interface SubscriptionViewMBean
      Returns:
      whether or not the subscriber is an exclusive consumer
    • isDurable

      public boolean isDurable()
      Specified by:
      isDurable in interface SubscriptionViewMBean
      Returns:
      whether or not the subscriber is durable (persistent)
    • isNoLocal

      public boolean isNoLocal()
      Specified by:
      isNoLocal in interface SubscriptionViewMBean
      Returns:
      whether or not the subscriber ignores local messages
    • isDispatchAsync

      public boolean isDispatchAsync()
      Specified by:
      isDispatchAsync in interface SubscriptionViewMBean
      Returns:
      whether or not the subscriber is configured for async dispatch
    • getMaximumPendingMessageLimit

      public int getMaximumPendingMessageLimit()
      Specified by:
      getMaximumPendingMessageLimit in interface SubscriptionViewMBean
      Returns:
      the maximum number of pending messages allowed in addition to the prefetch size. If enabled to a non-zero value then this will perform eviction of messages for slow consumers on non-durable topics.
    • getPriority

      public byte getPriority()
      Specified by:
      getPriority in interface SubscriptionViewMBean
      Returns:
      the consumer priority
    • getSubscriptionName

      public String getSubscriptionName()
      Specified by:
      getSubscriptionName in interface SubscriptionViewMBean
      Returns:
      the name of the consumer which is only used for durable consumers.
    • getPendingQueueSize

      public int getPendingQueueSize()
      Specified by:
      getPendingQueueSize in interface SubscriptionViewMBean
      Returns:
      number of messages pending delivery
    • getDispatchedQueueSize

      public int getDispatchedQueueSize()
      Specified by:
      getDispatchedQueueSize in interface SubscriptionViewMBean
      Returns:
      number of messages dispatched
    • getMessageCountAwaitingAcknowledge

      public int getMessageCountAwaitingAcknowledge()
      Description copied from interface: SubscriptionViewMBean
      The same as the number of messages dispatched - making it explicit
      Specified by:
      getMessageCountAwaitingAcknowledge in interface SubscriptionViewMBean
      Returns:
      number of messages waiting for an acknowledge.
    • getDispatchedCounter

      public long getDispatchedCounter()
      Specified by:
      getDispatchedCounter in interface SubscriptionViewMBean
      Returns:
      number of messages that matched the subscription
    • getEnqueueCounter

      public long getEnqueueCounter()
      Specified by:
      getEnqueueCounter in interface SubscriptionViewMBean
      Returns:
      number of messages that matched the subscription
    • getDequeueCounter

      public long getDequeueCounter()
      Specified by:
      getDequeueCounter in interface SubscriptionViewMBean
      Returns:
      number of messages queued by the client
    • getConsumerInfo

      protected org.apache.activemq.command.ConsumerInfo getConsumerInfo()
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      pretty print
    • getPrefetchSize

      public int getPrefetchSize()
      Specified by:
      getPrefetchSize in interface SubscriptionViewMBean
      Returns:
      the prefetch that has been configured for this subscriber
    • isMatchingQueue

      public boolean isMatchingQueue(String queueName)
      Description copied from interface: SubscriptionViewMBean
      Returns true if this subscription (which may be using wildcards) matches the given queue name
      Specified by:
      isMatchingQueue in interface SubscriptionViewMBean
      Parameters:
      queueName - the JMS queue name to match against
      Returns:
      true if this subscription matches the given queue or false if not
    • isMatchingTopic

      public boolean isMatchingTopic(String topicName)
      Description copied from interface: SubscriptionViewMBean
      Returns true if this subscription (which may be using wildcards) matches the given topic name
      Specified by:
      isMatchingTopic in interface SubscriptionViewMBean
      Parameters:
      topicName - the JMS topic name to match against
      Returns:
      true if this subscription matches the given topic or false if not
    • matchesDestination

      public boolean matchesDestination(org.apache.activemq.command.ActiveMQDestination destination)
      Return true if this subscription matches the given destination
      Parameters:
      destination - the destination to compare against
      Returns:
      true if this subscription matches the given destination
    • isSlowConsumer

      public boolean isSlowConsumer()
      Description copied from interface: SubscriptionViewMBean
      Returns true if the subscription is slow
      Specified by:
      isSlowConsumer in interface SubscriptionViewMBean
      Returns:
      true if the subscription is slow
    • getUserName

      public String getUserName()
      Description copied from interface: SubscriptionViewMBean
      Returns the User Name used to authorize creation of this Subscription. This value can be null if display of user name information is disabled.
      Specified by:
      getUserName in interface SubscriptionViewMBean
      Returns:
      the name of the user that created this Subscription
    • resetStatistics

      public void resetStatistics()
      Specified by:
      resetStatistics in interface SubscriptionViewMBean
    • getConsumedCount

      public long getConsumedCount()
      Specified by:
      getConsumedCount in interface SubscriptionViewMBean