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
Modifier and TypeFieldDescriptionprotected final String
protected final Subscription
protected final String
-
Constructor Summary
ConstructorDescriptionSubscriptionView
(String clientId, String userName, Subscription subs) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
gc()
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.long
protected org.apache.activemq.command.ConsumerInfo
long
long
int
long
int
int
The same as the number of messages dispatched - making it explicitint
int
byte
long
long
Returns the User Name used to authorize creation of this Subscription.boolean
isActive()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isMatchingQueue
(String queueName) Returns true if this subscription (which may be using wildcards) matches the given queue nameboolean
isMatchingTopic
(String topicName) Returns true if this subscription (which may be using wildcards) matches the given topic nameboolean
boolean
boolean
boolean
Returns true if the subscription is slowboolean
matchesDestination
(org.apache.activemq.command.ActiveMQDestination destination) Return true if this subscription matches the given destinationvoid
void
setSelector
(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:
getClientId
in interfaceSubscriptionViewMBean
- Returns:
- the clientId
-
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 interfaceSubscriptionViewMBean
- Returns:
- the name of the Connection that created this Subscription.
-
getConnectionId
- Specified by:
getConnectionId
in interfaceSubscriptionViewMBean
- Returns:
- the id of the Connection the Subscription is on
-
getSessionId
public long getSessionId()- Specified by:
getSessionId
in interfaceSubscriptionViewMBean
- Returns:
- the id of the Session the subscription is on
-
getSubscriptionId
public long getSubscriptionId()- Specified by:
getSubscriptionId
in interfaceSubscriptionViewMBean
- Returns:
- the id of the Subscription
-
getDestinationName
- Specified by:
getDestinationName
in interfaceSubscriptionViewMBean
- Returns:
- the destination name
-
getSelector
- Specified by:
getSelector
in interfaceSubscriptionViewMBean
- 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 interfaceSubscriptionViewMBean
- Throws:
jakarta.jms.InvalidSelectorException
UnsupportedOperationException
-
isDestinationQueue
public boolean isDestinationQueue()- Specified by:
isDestinationQueue
in interfaceSubscriptionViewMBean
- Returns:
- true if the destination is a Queue
-
isDestinationTopic
public boolean isDestinationTopic()- Specified by:
isDestinationTopic
in interfaceSubscriptionViewMBean
- Returns:
- true of the destination is a Topic
-
isDestinationTemporary
public boolean isDestinationTemporary()- Specified by:
isDestinationTemporary
in interfaceSubscriptionViewMBean
- Returns:
- true if the destination is temporary
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceSubscriptionViewMBean
- Returns:
- true if the subscriber is active
-
isNetwork
public boolean isNetwork()- Specified by:
isNetwork
in 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:
isRetroactive
in interfaceSubscriptionViewMBean
- Returns:
- whether or not the subscriber is retroactive or not
-
isExclusive
public boolean isExclusive()- Specified by:
isExclusive
in interfaceSubscriptionViewMBean
- Returns:
- whether or not the subscriber is an exclusive consumer
-
isDurable
public boolean isDurable()- Specified by:
isDurable
in interfaceSubscriptionViewMBean
- Returns:
- whether or not the subscriber is durable (persistent)
-
isNoLocal
public boolean isNoLocal()- Specified by:
isNoLocal
in interfaceSubscriptionViewMBean
- Returns:
- whether or not the subscriber ignores local messages
-
isDispatchAsync
public boolean isDispatchAsync()- Specified by:
isDispatchAsync
in interfaceSubscriptionViewMBean
- Returns:
- whether or not the subscriber is configured for async dispatch
-
getMaximumPendingMessageLimit
public int getMaximumPendingMessageLimit()- Specified by:
getMaximumPendingMessageLimit
in 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:
getPriority
in interfaceSubscriptionViewMBean
- Returns:
- the consumer priority
-
getSubscriptionName
- Specified by:
getSubscriptionName
in interfaceSubscriptionViewMBean
- Returns:
- the name of the consumer which is only used for durable consumers.
-
getPendingQueueSize
public int getPendingQueueSize()- Specified by:
getPendingQueueSize
in interfaceSubscriptionViewMBean
- Returns:
- number of messages pending delivery
-
getDispatchedQueueSize
public int getDispatchedQueueSize()- Specified by:
getDispatchedQueueSize
in interfaceSubscriptionViewMBean
- 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 interfaceSubscriptionViewMBean
- Returns:
- number of messages waiting for an acknowledge.
-
getDispatchedCounter
public long getDispatchedCounter()- Specified by:
getDispatchedCounter
in interfaceSubscriptionViewMBean
- Returns:
- number of messages that matched the subscription
-
getEnqueueCounter
public long getEnqueueCounter()- Specified by:
getEnqueueCounter
in interfaceSubscriptionViewMBean
- Returns:
- number of messages that matched the subscription
-
getDequeueCounter
public long getDequeueCounter()- Specified by:
getDequeueCounter
in interfaceSubscriptionViewMBean
- Returns:
- number of messages queued by the client
-
getConsumerInfo
protected org.apache.activemq.command.ConsumerInfo getConsumerInfo() -
toString
-
getPrefetchSize
public int getPrefetchSize()- Specified by:
getPrefetchSize
in interfaceSubscriptionViewMBean
- Returns:
- the prefetch that has been configured for this subscriber
-
isMatchingQueue
Description copied from interface:SubscriptionViewMBean
Returns true if this subscription (which may be using wildcards) matches the given queue name- Specified by:
isMatchingQueue
in 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:SubscriptionViewMBean
Returns true if this subscription (which may be using wildcards) matches the given topic name- Specified by:
isMatchingTopic
in 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:SubscriptionViewMBean
Returns true if the subscription is slow- Specified by:
isSlowConsumer
in interfaceSubscriptionViewMBean
- Returns:
- true if the subscription is slow
-
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 interfaceSubscriptionViewMBean
- Returns:
- the name of the user that created this Subscription
-
resetStatistics
public void resetStatistics()- Specified by:
resetStatistics
in interfaceSubscriptionViewMBean
-
getConsumedCount
public long getConsumedCount()- Specified by:
getConsumedCount
in interfaceSubscriptionViewMBean
-