Method Summary
All Methods Instance Methods Abstract Methods
void
Used when client acknowledge receipt of dispatched message.
void
The subscription will be receiving messages from the destination.
void
add (org.apache.activemq.broker.region.MessageReference node)
Used to add messages that match the subscription.
int
void
Called when the subscription is destroyed.
void
The subscription should release as may references as it can to help the garbage collector
reclaim memory.
long
org.apache.activemq.command.ConsumerInfo
The ConsumerInfo object that created the subscription.
int
long
long
int
long
long
int
int
long
int
int
long
Returns the time since the last Ack message was received by this subscription.
void
boolean
boolean
boolean
boolean
boolean
Informs the Broker if the subscription needs to intervention to recover it's state
e.g.
boolean
boolean
Returns true if this subscription is a Wildcard subscription.
boolean
matches (org.apache.activemq.broker.region.MessageReference node,
org.apache.activemq.filter.MessageEvaluationContext context)
Is the subscription interested in the message?
boolean
matches (org.apache.activemq.command.ActiveMQDestination destination)
Is the subscription interested in messages in the destination?
void
Used by a Slave Broker to update dispatch infomation
org.apache.activemq.command.Response
Allows a consumer to pull a message on demand
List <org.apache.activemq.broker.region.MessageReference>
The subscription will be no longer be receiving messages from the destination.
void
void
void
Set when the subscription is registered in JMX
void
Attempts to change the current active selector on the subscription.
void
unmatched (org.apache.activemq.broker.region.MessageReference node)
void
inform the MessageConsumer on the client to change it's prefetch
Method Details
acknowledge
Used when client acknowledge receipt of dispatched message.
Throws:
IOException
Exception
pullMessage
org.apache.activemq.command.Response pullMessage (ConnectionContext context,
org.apache.activemq.command.MessagePull pull)
throws Exception
Allows a consumer to pull a message on demand
Throws:
Exception
isWildcard
boolean isWildcard ()
Returns true if this subscription is a Wildcard subscription.
Returns:
true if wildcard subscription.
matches
boolean matches (org.apache.activemq.broker.region.MessageReference node,
org.apache.activemq.filter.MessageEvaluationContext context)
throws IOException
Is the subscription interested in the message?
Parameters:
node -
context -
Returns:
true if matching
Throws:
IOException
matches
boolean matches (org.apache.activemq.command.ActiveMQDestination destination)
Is the subscription interested in messages in the destination?
Parameters:
destination -
Returns:
true if matching
add
The subscription will be receiving messages from the destination.
Parameters:
context -
destination -
Throws:
Exception
remove
The subscription will be no longer be receiving messages from the destination.
Parameters:
context -
destination -
Returns:
a list of un-acked messages that were added to the subscription.
Throws:
Exception
getConsumerInfo
org.apache.activemq.command.ConsumerInfo getConsumerInfo ()
The ConsumerInfo object that created the subscription.
gc
void gc ()
The subscription should release as may references as it can to help the garbage collector
reclaim memory.
processMessageDispatchNotification
void processMessageDispatchNotification (org.apache.activemq.command.MessageDispatchNotification mdn)
throws Exception
Used by a Slave Broker to update dispatch infomation
Parameters:
mdn -
Throws:
Exception
getPendingQueueSize
int getPendingQueueSize ()
Returns:
number of messages pending delivery
getPendingMessageSize
long getPendingMessageSize ()
Returns:
size of the messages pending delivery
getDispatchedQueueSize
int getDispatchedQueueSize ()
Returns:
number of messages dispatched to the client
getDispatchedCounter
long getDispatchedCounter ()
Returns:
number of messages dispatched to the client
getEnqueueCounter
long getEnqueueCounter ()
Returns:
number of messages that matched the subscription
getDequeueCounter
long getDequeueCounter ()
Returns:
number of messages queued by the client
getSubscriptionStatistics
getSelector
Returns:
the JMS selector on the current subscription
setSelector
Attempts to change the current active selector on the subscription.
This operation is not supported for persistent topics.
Throws:
jakarta.jms.InvalidSelectorException
UnsupportedOperationException
getObjectName
Returns:
the JMX object name that this subscription was registered as if applicable
setObjectName
Set when the subscription is registered in JMX
isLowWaterMark
boolean isLowWaterMark ()
Returns:
true when 60% or more room is left for dispatching messages
isHighWaterMark
boolean isHighWaterMark ()
Returns:
true when 10% or less room is left for dispatching messages
isFull
boolean isFull ()
Returns:
true if there is no space to dispatch messages
updateConsumerPrefetch
void updateConsumerPrefetch (int newPrefetch)
inform the MessageConsumer on the client to change it's prefetch
Parameters:
newPrefetch -
destroy
void destroy ()
Called when the subscription is destroyed.
getPrefetchSize
int getPrefetchSize ()
Returns:
the prefetch size that is configured for the subscription
getInFlightSize
int getInFlightSize ()
Returns:
the number of messages awaiting acknowledgement
getInFlightMessageSize
long getInFlightMessageSize ()
Returns:
the size in bytes of the messages awaiting acknowledgement
getInFlightUsage
int getInFlightUsage ()
Returns:
the in flight messages as a percentage of the prefetch size
isRecoveryRequired
boolean isRecoveryRequired ()
Informs the Broker if the subscription needs to intervention to recover it's state
e.g. DurableTopicSubscriber may do
Returns:
true if recovery required
See Also:
isBrowser
boolean isBrowser ()
Returns:
true if a browser
countBeforeFull
int countBeforeFull ()
Returns:
the number of messages this subscription can accept before its full
getCursorMemoryHighWaterMark
int getCursorMemoryHighWaterMark ()
setCursorMemoryHighWaterMark
void setCursorMemoryHighWaterMark (int cursorMemoryHighWaterMark)
isSlowConsumer
boolean isSlowConsumer ()
unmatched
void unmatched (org.apache.activemq.broker.region.MessageReference node)
throws IOException
Throws:
IOException
getTimeOfLastMessageAck
long getTimeOfLastMessageAck ()
Returns the time since the last Ack message was received by this subscription.
If there has never been an ack this value should be set to the creation time of the
subscription.
Returns:
time of last received Ack message or Subscription create time if no Acks.
getConsumedCount
long getConsumedCount ()
incrementConsumedCount
void incrementConsumedCount ()
resetConsumedCount
void resetConsumedCount ()