Class StoreDurableSubscriberCursor
java.lang.Object
org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor
- All Implemented Interfaces:
PendingMessageCursor,org.apache.activemq.Service
persist pending messages pending message (messages awaiting dispatch to a
consumer) cursor
-
Field Summary
Fields inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
audit, cacheEnabled, enableAudit, last, maxAuditDepth, maxBatchSize, maxProducersToAudit, memoryUsageHighWaterMark, prioritizedMessages, started, systemUsage, useCacheFields inherited from interface org.apache.activemq.broker.region.cursors.PendingMessageCursor
INFINITE_WAIT -
Constructor Summary
ConstructorsConstructorDescriptionStoreDurableSubscriberCursor(Broker broker, String clientId, String subscriberName, int maxBatchSize, DurableTopicSubscription subscription) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ConnectionContext context, Destination destination) Add a destinationvoidaddMessageFirst(org.apache.activemq.broker.region.MessageReference node) add message to await dispatchvoidaddRecoveredMessage(org.apache.activemq.broker.region.MessageReference node) Add a message recovered from a retroactive policyvoidclear()clear all pending messagesvoidgc()free up any internal buffersprotected PendingMessageCursorbooleanhasNext()booleanisEmpty()booleanisEmpty(Destination destination) check if a Destination is Empty for this cursorbooleanbooleanInforms the Broker if the subscription needs to intervention to recover it's state e.g.booleanlongorg.apache.activemq.broker.region.MessageReferencenext()voidrelease()hint to the cursor to release any locks it might have grabbed after a resetvoidremove()remove the message at the cursor positionList<org.apache.activemq.broker.region.MessageReference>remove(ConnectionContext context, Destination destination) remove a destinationvoidremove(org.apache.activemq.broker.region.MessageReference node) remove a nodevoidreset()reset the cursorvoidsetEnableAudit(boolean enableAudit) voidsetImmediatePriorityDispatch(boolean immediatePriorityDispatch) voidsetMaxAuditDepth(int maxAuditDepth) Set the maximum depth of message ids to trackvoidsetMaxBatchSize(int newMaxBatchSize) Set the max batch sizevoidsetMaxProducersToAudit(int maxProducersToAudit) set the maximum number of producers to track at one timevoidsetMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) voidsetSystemUsage(SystemUsage usageManager) Set the UsageManagervoidsetUseCache(boolean useCache) use a cache to improve performanceintsize()voidstart()voidstop()toString()booleantryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long wait) add message to await dispatch - if it canMethods inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
addMessageLast, destroy, fillBatch, getMaxAuditDepth, getMaxBatchSize, getMaxProducersToAudit, getMemoryUsageHighWaterMark, getMessageAudit, getSystemUsage, hasMessagesBufferedToDeliver, hasSpace, isCacheEnabled, isDuplicate, isEnableAudit, isFull, isPrioritizedMessageSubscriber, isStarted, isUseCache, pageInList, rebase, recordUniqueId, resetForGC, rollback, setCacheEnabled, setMessageAudit
-
Constructor Details
-
StoreDurableSubscriberCursor
public StoreDurableSubscriberCursor(Broker broker, String clientId, String subscriberName, int maxBatchSize, DurableTopicSubscription subscription) - Parameters:
broker- Broker for this cursorclientId- clientId for this cursorsubscriberName- subscriber name for this cursormaxBatchSize- currently ignoredsubscription- subscription for this cursor
-
-
Method Details
-
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Overrides:
startin classAbstractPendingMessageCursor- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Overrides:
stopin classAbstractPendingMessageCursor- Throws:
Exception
-
add
Add a destination- Specified by:
addin interfacePendingMessageCursor- Overrides:
addin classAbstractPendingMessageCursor- Parameters:
context-destination-- Throws:
Exception
-
remove
public List<org.apache.activemq.broker.region.MessageReference> remove(ConnectionContext context, Destination destination) throws Exception remove a destination- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor- Parameters:
context-destination-- Throws:
Exception
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacePendingMessageCursor- Overrides:
isEmptyin classAbstractPendingMessageCursor- Returns:
- true if there are no pending messages
-
isEmpty
Description copied from interface:PendingMessageCursorcheck if a Destination is Empty for this cursor- Specified by:
isEmptyin interfacePendingMessageCursor- Overrides:
isEmptyin classAbstractPendingMessageCursor- Returns:
- true id the Destination is empty
-
isRecoveryRequired
public boolean isRecoveryRequired()Informs the Broker if the subscription needs to intervention to recover it's state e.g. DurableTopicSubscriber may do- Specified by:
isRecoveryRequiredin interfacePendingMessageCursor- Overrides:
isRecoveryRequiredin classAbstractPendingMessageCursor- Returns:
- true if recovery required
- See Also:
-
tryAddMessageLast
public boolean tryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long wait) throws Exception Description copied from interface:PendingMessageCursoradd message to await dispatch - if it can- Specified by:
tryAddMessageLastin interfacePendingMessageCursor- Overrides:
tryAddMessageLastin classAbstractPendingMessageCursor- Returns:
- true if successful
- Throws:
IOExceptionException
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfacePendingMessageCursor- Overrides:
isTransientin classAbstractPendingMessageCursor- Returns:
- true if the underlying state of this cursor disappears when the broker shuts down
-
addMessageFirst
public void addMessageFirst(org.apache.activemq.broker.region.MessageReference node) throws Exception Description copied from interface:PendingMessageCursoradd message to await dispatch- Specified by:
addMessageFirstin interfacePendingMessageCursor- Overrides:
addMessageFirstin classAbstractPendingMessageCursor- Throws:
Exception
-
addRecoveredMessage
public void addRecoveredMessage(org.apache.activemq.broker.region.MessageReference node) throws Exception Description copied from interface:PendingMessageCursorAdd a message recovered from a retroactive policy- Specified by:
addRecoveredMessagein interfacePendingMessageCursor- Overrides:
addRecoveredMessagein classAbstractPendingMessageCursor- Throws:
Exception
-
clear
public void clear()Description copied from interface:PendingMessageCursorclear all pending messages- Specified by:
clearin interfacePendingMessageCursor- Overrides:
clearin classAbstractPendingMessageCursor
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacePendingMessageCursor- Overrides:
hasNextin classAbstractPendingMessageCursor- Returns:
- true if there pending messages to dispatch
-
next
public org.apache.activemq.broker.region.MessageReference next()- Specified by:
nextin interfacePendingMessageCursor- Overrides:
nextin classAbstractPendingMessageCursor- Returns:
- the next pending message with its reference count increment
-
remove
public void remove()Description copied from interface:PendingMessageCursorremove the message at the cursor position- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
remove
public void remove(org.apache.activemq.broker.region.MessageReference node) Description copied from interface:PendingMessageCursorremove a node- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
reset
public void reset()Description copied from interface:PendingMessageCursorreset the cursor- Specified by:
resetin interfacePendingMessageCursor- Overrides:
resetin classAbstractPendingMessageCursor
-
release
public void release()Description copied from interface:PendingMessageCursorhint to the cursor to release any locks it might have grabbed after a reset- Specified by:
releasein interfacePendingMessageCursor- Overrides:
releasein classAbstractPendingMessageCursor
-
size
public int size()- Specified by:
sizein interfacePendingMessageCursor- Overrides:
sizein classAbstractPendingMessageCursor- Returns:
- the number of pending messages
-
messageSize
public long messageSize() -
setMaxBatchSize
public void setMaxBatchSize(int newMaxBatchSize) Description copied from interface:PendingMessageCursorSet the max batch size- Specified by:
setMaxBatchSizein interfacePendingMessageCursor- Overrides:
setMaxBatchSizein classAbstractPendingMessageCursor
-
gc
public void gc()Description copied from interface:PendingMessageCursorfree up any internal buffers- Specified by:
gcin interfacePendingMessageCursor- Overrides:
gcin classAbstractPendingMessageCursor
-
setSystemUsage
Description copied from interface:PendingMessageCursorSet the UsageManager- Specified by:
setSystemUsagein interfacePendingMessageCursor- Overrides:
setSystemUsagein classAbstractPendingMessageCursor- See Also:
-
setMemoryUsageHighWaterMark
public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) - Specified by:
setMemoryUsageHighWaterMarkin interfacePendingMessageCursor- Overrides:
setMemoryUsageHighWaterMarkin classAbstractPendingMessageCursor- Parameters:
memoryUsageHighWaterMark- the memoryUsageHighWaterMark to set
-
setMaxProducersToAudit
public void setMaxProducersToAudit(int maxProducersToAudit) Description copied from interface:PendingMessageCursorset the maximum number of producers to track at one time- Specified by:
setMaxProducersToAuditin interfacePendingMessageCursor- Overrides:
setMaxProducersToAuditin classAbstractPendingMessageCursor- Parameters:
maxProducersToAudit- the maxProducersToAudit to set
-
setMaxAuditDepth
public void setMaxAuditDepth(int maxAuditDepth) Description copied from interface:PendingMessageCursorSet the maximum depth of message ids to track- Specified by:
setMaxAuditDepthin interfacePendingMessageCursor- Overrides:
setMaxAuditDepthin classAbstractPendingMessageCursor- Parameters:
maxAuditDepth- the maxAuditDepth to set
-
setEnableAudit
public void setEnableAudit(boolean enableAudit) - Specified by:
setEnableAuditin interfacePendingMessageCursor- Overrides:
setEnableAuditin classAbstractPendingMessageCursor- Parameters:
enableAudit- the enableAudit to set
-
setUseCache
public void setUseCache(boolean useCache) Description copied from interface:PendingMessageCursoruse a cache to improve performance- Specified by:
setUseCachein interfacePendingMessageCursor- Overrides:
setUseCachein classAbstractPendingMessageCursor
-
getNextCursor
- Throws:
Exception
-
toString
-
isImmediatePriorityDispatch
public boolean isImmediatePriorityDispatch() -
setImmediatePriorityDispatch
public void setImmediatePriorityDispatch(boolean immediatePriorityDispatch)
-