public class DurableTopicSubscription extends PrefetchSubscription implements org.apache.activemq.usage.UsageListener
dispatched, dispatchLock, pending, pendingLock, scheduler, usageManager
broker, context, destinationFilter, destinations, info, prefetchExtension
Constructor and Description |
---|
DurableTopicSubscription(Broker broker,
SystemUsage usageManager,
ConnectionContext context,
org.apache.activemq.command.ConsumerInfo info,
boolean keepDurableSubsActive) |
Modifier and Type | Method and Description |
---|---|
protected void |
acknowledge(ConnectionContext context,
org.apache.activemq.command.MessageAck ack,
org.apache.activemq.broker.region.MessageReference node)
Used during acknowledgment to remove the message.
|
void |
activate(SystemUsage memoryManager,
ConnectionContext context,
org.apache.activemq.command.ConsumerInfo info,
RegionBroker regionBroker) |
void |
add(ConnectionContext context,
Destination destination)
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.
|
protected boolean |
canDispatch(org.apache.activemq.broker.region.MessageReference node)
Use when a matched message is about to be dispatched to the client.
|
protected org.apache.activemq.command.MessageDispatch |
createMessageDispatch(org.apache.activemq.broker.region.MessageReference node,
org.apache.activemq.command.Message message) |
void |
deactivate(boolean keepDurableSubsActive,
long lastDeliveredSequenceId) |
void |
destroy()
Release any references that we are holding.
|
void |
dispatchPending() |
protected void |
doAddRecoveredMessage(org.apache.activemq.broker.region.MessageReference message) |
void |
gc()
The subscription should release as may references as it can to help the garbage collector
reclaim memory.
|
long |
getOfflineTimestamp() |
int |
getPendingQueueSize() |
SubscriptionKey |
getSubscriptionKey() |
boolean |
isActive() |
protected boolean |
isDropped(org.apache.activemq.broker.region.MessageReference node) |
boolean |
isEmpty(Topic topic) |
boolean |
isFull()
Used to determine if the broker can dispatch to the consumer.
|
boolean |
isKeepDurableSubsActive() |
void |
onUsageChanged(org.apache.activemq.usage.Usage usage,
int oldPercentUsage,
int newPercentUsage) |
void |
removePending(org.apache.activemq.broker.region.MessageReference node) |
void |
setOfflineTimestamp(long timestamp) |
protected void |
setPendingBatchSize(PendingMessageCursor pending,
int numberToDispatch) |
void |
setSelector(String selector)
Attempts to change the current active selector on the subscription.
|
String |
toString() |
void |
unmatched(org.apache.activemq.broker.region.MessageReference node)
store will have a pending ack for all durables, irrespective of the
selector so we need to ack if node is un-matched
|
acknowledge, assertAckMatchesDispatched, countBeforeFull, dispatch, getDequeueCounter, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getInFlightSize, getMaxAuditDepth, getMaxProducersToAudit, getPending, getPendingMessageSize, isHighWaterMark, isLowWaterMark, isRecoveryRequired, onDispatch, processMessageDispatchNotification, pullMessage, remove, remove, sendToDLQ, setMaxAuditDepth, setMaxProducersToAudit, setPending, setPrefetchSize, updateConsumerPrefetch
addDestination, addRecoveredMessage, contractPrefetchExtension, decrementPrefetchExtension, expandPrefetchExtension, getActiveMQDestination, getConsumedCount, getConsumerInfo, getContext, getCursorMemoryHighWaterMark, getInFlightMessageSize, getInFlightUsage, getInfo, getObjectName, getPrefetchExtension, getPrefetchSize, getSelector, getSelectorExpression, getSubscriptionStatistics, getTimeOfLastMessageAck, incrementConsumedCount, isBrowser, isSlowConsumer, isUsePrefetchExtension, isWildcard, matches, matches, removeDestination, resetConsumedCount, setCursorMemoryHighWaterMark, setObjectName, setSlowConsumer, setTimeOfLastMessageAck, setUsePrefetchExtension, wakeupDestinationsForDispatch
public DurableTopicSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, org.apache.activemq.command.ConsumerInfo info, boolean keepDurableSubsActive) throws javax.jms.JMSException
javax.jms.JMSException
public final boolean isActive()
public final long getOfflineTimestamp()
public void setOfflineTimestamp(long timestamp)
public boolean isFull()
PrefetchSubscription
isFull
in interface Subscription
isFull
in class PrefetchSubscription
public void gc()
Subscription
gc
in interface Subscription
gc
in class AbstractSubscription
public void unmatched(org.apache.activemq.broker.region.MessageReference node) throws IOException
unmatched
in interface Subscription
unmatched
in class AbstractSubscription
IOException
protected void setPendingBatchSize(PendingMessageCursor pending, int numberToDispatch)
setPendingBatchSize
in class PrefetchSubscription
public void add(ConnectionContext context, Destination destination) throws Exception
Subscription
add
in interface Subscription
add
in class PrefetchSubscription
Exception
public void activate(SystemUsage memoryManager, ConnectionContext context, org.apache.activemq.command.ConsumerInfo info, RegionBroker regionBroker) throws Exception
Exception
public void deactivate(boolean keepDurableSubsActive, long lastDeliveredSequenceId) throws Exception
Exception
protected org.apache.activemq.command.MessageDispatch createMessageDispatch(org.apache.activemq.broker.region.MessageReference node, org.apache.activemq.command.Message message)
createMessageDispatch
in class PrefetchSubscription
public void add(org.apache.activemq.broker.region.MessageReference node) throws Exception
Subscription
add
in interface Subscription
add
in class PrefetchSubscription
Exception
InterruptedException
IOException
public void dispatchPending() throws IOException
dispatchPending
in class PrefetchSubscription
IOException
public void removePending(org.apache.activemq.broker.region.MessageReference node) throws IOException
IOException
protected void doAddRecoveredMessage(org.apache.activemq.broker.region.MessageReference message) throws Exception
doAddRecoveredMessage
in class AbstractSubscription
Exception
public int getPendingQueueSize()
getPendingQueueSize
in interface Subscription
getPendingQueueSize
in class PrefetchSubscription
public void setSelector(String selector) throws javax.jms.InvalidSelectorException
Subscription
setSelector
in interface Subscription
setSelector
in class AbstractSubscription
javax.jms.InvalidSelectorException
protected boolean canDispatch(org.apache.activemq.broker.region.MessageReference node)
PrefetchSubscription
canDispatch
in class PrefetchSubscription
protected void acknowledge(ConnectionContext context, org.apache.activemq.command.MessageAck ack, org.apache.activemq.broker.region.MessageReference node) throws IOException
PrefetchSubscription
acknowledge
in class PrefetchSubscription
IOException
public SubscriptionKey getSubscriptionKey()
public void destroy()
destroy
in interface Subscription
public void onUsageChanged(org.apache.activemq.usage.Usage usage, int oldPercentUsage, int newPercentUsage)
onUsageChanged
in interface org.apache.activemq.usage.UsageListener
protected boolean isDropped(org.apache.activemq.broker.region.MessageReference node)
isDropped
in class PrefetchSubscription
public boolean isKeepDurableSubsActive()
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.