Package org.apache.activemq.broker.jmx
Class SubscriptionView
java.lang.Object
org.apache.activemq.broker.jmx.SubscriptionView
- All Implemented Interfaces:
SubscriptionViewMBean
- Direct Known Subclasses:
DurableSubscriptionView,TopicSubscriptionView
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Subscriptionprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionSubscriptionView(String clientId, String userName, Subscription subs) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidgc()The subscription should release as may references as it can to help the garbage collector reclaim memory.Returns the ObjectName of the Connection that created this Subscription.longprotected org.apache.activemq.command.ConsumerInfolonglongintlongintintThe same as the number of messages dispatched - making it explicitintintbytelonglongReturns the User Name used to authorize creation of this Subscription.booleanisActive()booleanbooleanbooleanbooleanbooleanbooleanbooleanisMatchingQueue(String queueName) Returns true if this subscription (which may be using wildcards) matches the given queue namebooleanisMatchingTopic(String topicName) Returns true if this subscription (which may be using wildcards) matches the given topic namebooleanbooleanbooleanbooleanReturns true if the subscription is slowbooleanmatchesDestination(org.apache.activemq.command.ActiveMQDestination destination) Return true if this subscription matches the given destinationvoidvoidsetSelector(String selector) Attempts to change the current active selector on the subscription.toString()
-
Field Details
-
subscription
-
clientId
-
userName
-
-
Constructor Details
-
SubscriptionView
Constructor- Parameters:
subs-
-
-
Method Details
-
getClientId
- Specified by:
getClientIdin interfaceSubscriptionViewMBean- Returns:
- the clientId
-
getConnection
Description copied from interface:SubscriptionViewMBeanReturns 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:
getConnectionin interfaceSubscriptionViewMBean- Returns:
- the name of the Connection that created this Subscription.
-
getConnectionId
- Specified by:
getConnectionIdin interfaceSubscriptionViewMBean- Returns:
- the id of the Connection the Subscription is on
-
getSessionId
public long getSessionId()- Specified by:
getSessionIdin interfaceSubscriptionViewMBean- Returns:
- the id of the Session the subscription is on
-
getSubscriptionId
public long getSubscriptionId()- Specified by:
getSubscriptionIdin interfaceSubscriptionViewMBean- Returns:
- the id of the Subscription
-
getDestinationName
- Specified by:
getDestinationNamein interfaceSubscriptionViewMBean- Returns:
- the destination name
-
getSelector
- Specified by:
getSelectorin interfaceSubscriptionViewMBean- Returns:
- the JMS selector on the current subscription
-
setSelector
public void setSelector(String selector) throws jakarta.jms.InvalidSelectorException, UnsupportedOperationException Description copied from interface:SubscriptionViewMBeanAttempts to change the current active selector on the subscription. This operation is not supported for persistent topics.- Specified by:
setSelectorin interfaceSubscriptionViewMBean- Throws:
jakarta.jms.InvalidSelectorExceptionUnsupportedOperationException
-
isDestinationQueue
public boolean isDestinationQueue()- Specified by:
isDestinationQueuein interfaceSubscriptionViewMBean- Returns:
- true if the destination is a Queue
-
isDestinationTopic
public boolean isDestinationTopic()- Specified by:
isDestinationTopicin interfaceSubscriptionViewMBean- Returns:
- true of the destination is a Topic
-
isDestinationTemporary
public boolean isDestinationTemporary()- Specified by:
isDestinationTemporaryin interfaceSubscriptionViewMBean- Returns:
- true if the destination is temporary
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceSubscriptionViewMBean- Returns:
- true if the subscriber is active
-
isNetwork
public boolean isNetwork()- Specified by:
isNetworkin interfaceSubscriptionViewMBean
-
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:
isRetroactivein interfaceSubscriptionViewMBean- Returns:
- whether or not the subscriber is retroactive or not
-
isExclusive
public boolean isExclusive()- Specified by:
isExclusivein interfaceSubscriptionViewMBean- Returns:
- whether or not the subscriber is an exclusive consumer
-
isDurable
public boolean isDurable()- Specified by:
isDurablein interfaceSubscriptionViewMBean- Returns:
- whether or not the subscriber is durable (persistent)
-
isNoLocal
public boolean isNoLocal()- Specified by:
isNoLocalin interfaceSubscriptionViewMBean- Returns:
- whether or not the subscriber ignores local messages
-
isDispatchAsync
public boolean isDispatchAsync()- Specified by:
isDispatchAsyncin interfaceSubscriptionViewMBean- Returns:
- whether or not the subscriber is configured for async dispatch
-
getMaximumPendingMessageLimit
public int getMaximumPendingMessageLimit()- Specified by:
getMaximumPendingMessageLimitin interfaceSubscriptionViewMBean- 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:
getPriorityin interfaceSubscriptionViewMBean- Returns:
- the consumer priority
-
getSubscriptionName
- Specified by:
getSubscriptionNamein interfaceSubscriptionViewMBean- Returns:
- the name of the consumer which is only used for durable consumers.
-
getPendingQueueSize
public int getPendingQueueSize()- Specified by:
getPendingQueueSizein interfaceSubscriptionViewMBean- Returns:
- number of messages pending delivery
-
getDispatchedQueueSize
public int getDispatchedQueueSize()- Specified by:
getDispatchedQueueSizein interfaceSubscriptionViewMBean- Returns:
- number of messages dispatched
-
getMessageCountAwaitingAcknowledge
public int getMessageCountAwaitingAcknowledge()Description copied from interface:SubscriptionViewMBeanThe same as the number of messages dispatched - making it explicit- Specified by:
getMessageCountAwaitingAcknowledgein interfaceSubscriptionViewMBean- Returns:
- number of messages waiting for an acknowledge.
-
getDispatchedCounter
public long getDispatchedCounter()- Specified by:
getDispatchedCounterin interfaceSubscriptionViewMBean- Returns:
- number of messages that matched the subscription
-
getEnqueueCounter
public long getEnqueueCounter()- Specified by:
getEnqueueCounterin interfaceSubscriptionViewMBean- Returns:
- number of messages that matched the subscription
-
getDequeueCounter
public long getDequeueCounter()- Specified by:
getDequeueCounterin interfaceSubscriptionViewMBean- Returns:
- number of messages queued by the client
-
getConsumerInfo
protected org.apache.activemq.command.ConsumerInfo getConsumerInfo() -
toString
-
getPrefetchSize
public int getPrefetchSize()- Specified by:
getPrefetchSizein interfaceSubscriptionViewMBean- Returns:
- the prefetch that has been configured for this subscriber
-
isMatchingQueue
Description copied from interface:SubscriptionViewMBeanReturns true if this subscription (which may be using wildcards) matches the given queue name- Specified by:
isMatchingQueuein interfaceSubscriptionViewMBean- Parameters:
queueName- the JMS queue name to match against- Returns:
- true if this subscription matches the given queue or false if not
-
isMatchingTopic
Description copied from interface:SubscriptionViewMBeanReturns true if this subscription (which may be using wildcards) matches the given topic name- Specified by:
isMatchingTopicin interfaceSubscriptionViewMBean- 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:SubscriptionViewMBeanReturns true if the subscription is slow- Specified by:
isSlowConsumerin interfaceSubscriptionViewMBean- Returns:
- true if the subscription is slow
-
getUserName
Description copied from interface:SubscriptionViewMBeanReturns 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:
getUserNamein interfaceSubscriptionViewMBean- Returns:
- the name of the user that created this Subscription
-
resetStatistics
public void resetStatistics()- Specified by:
resetStatisticsin interfaceSubscriptionViewMBean
-
getConsumedCount
public long getConsumedCount()- Specified by:
getConsumedCountin interfaceSubscriptionViewMBean
-