Interface PendingMessageCursor
-
- All Superinterfaces:
org.apache.activemq.Service
- All Known Implementing Classes:
AbstractPendingMessageCursor,AbstractStoreCursor,FilePendingMessageCursor,StoreDurableSubscriberCursor,StoreQueueCursor,VMPendingMessageCursor
public interface PendingMessageCursor extends org.apache.activemq.ServiceInterface to pending message (messages awaiting disptach to a consumer) cursor
-
-
Field Summary
Fields Modifier and Type Field Description static longINFINITE_WAIT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(ConnectionContext context, Destination destination)Add a destinationvoidaddMessageFirst(org.apache.activemq.broker.region.MessageReference node)add message to await dispatchbooleanaddMessageLast(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 messagesvoiddestroy()destroy the cursorvoidgc()free up any internal buffersintgetMaxAuditDepth()intgetMaxBatchSize()intgetMaxProducersToAudit()intgetMemoryUsageHighWaterMark()org.apache.activemq.ActiveMQMessageAuditgetMessageAudit()SystemUsagegetSystemUsage()booleanhasMessagesBufferedToDeliver()booleanhasNext()booleanhasSpace()booleanisCacheEnabled()booleanisEmpty()booleanisEmpty(Destination destination)check if a Destination is Empty for this cursorbooleanisEnableAudit()booleanisFull()booleanisRecoveryRequired()Informs the Broker if the subscription needs to intervention to recover it's state e.g.booleanisTransient()booleanisUseCache()longmessageSize()org.apache.activemq.broker.region.MessageReferencenext()LinkedList<org.apache.activemq.broker.region.MessageReference>pageInList(int maxItems)Page in a restricted number of messages and increment the reference countvoidrebase()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 cursorvoidresetForGC()Give the cursor a hint that we are about to remove messages from memory onlyvoidrollback(org.apache.activemq.command.MessageId id)remove from auditing the message idvoidsetEnableAudit(boolean enableAudit)voidsetMaxAuditDepth(int depth)Set the maximum depth of message ids to trackvoidsetMaxBatchSize(int maxBatchSize)Set the max batch sizevoidsetMaxProducersToAudit(int value)set the maximum number of producers to track at one timevoidsetMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)voidsetMessageAudit(org.apache.activemq.ActiveMQMessageAudit audit)set the auditvoidsetSystemUsage(SystemUsage systemUsage)Set the UsageManagervoidsetUseCache(boolean useCache)use a cache to improve performanceintsize()booleantryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long maxWaitTime)add message to await dispatch - if it can
-
-
-
Field Detail
-
INFINITE_WAIT
static final long INFINITE_WAIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
void add(ConnectionContext context, Destination destination) throws Exception
Add a destination- Parameters:
context-destination-- Throws:
Exception
-
remove
List<org.apache.activemq.broker.region.MessageReference> remove(ConnectionContext context, Destination destination) throws Exception
remove a destination- Parameters:
context-destination-- Throws:
Exception
-
isEmpty
boolean isEmpty()
- Returns:
- true if there are no pending messages
-
isEmpty
boolean isEmpty(Destination destination)
check if a Destination is Empty for this cursor- Parameters:
destination-- Returns:
- true id the Destination is empty
-
reset
void reset()
reset the cursor
-
release
void release()
hint to the cursor to release any locks it might have grabbed after a reset
-
addMessageLast
boolean addMessageLast(org.apache.activemq.broker.region.MessageReference node) throws Exceptionadd message to await dispatch- Parameters:
node-- Returns:
- boolean true if successful, false if cursor traps a duplicate
- Throws:
IOExceptionException
-
tryAddMessageLast
boolean tryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long maxWaitTime) throws Exceptionadd message to await dispatch - if it can- Parameters:
node-maxWaitTime-- Returns:
- true if successful
- Throws:
IOExceptionException
-
addMessageFirst
void addMessageFirst(org.apache.activemq.broker.region.MessageReference node) throws Exceptionadd message to await dispatch- Parameters:
node-- Throws:
Exception
-
addRecoveredMessage
void addRecoveredMessage(org.apache.activemq.broker.region.MessageReference node) throws ExceptionAdd a message recovered from a retroactive policy- Parameters:
node-- Throws:
Exception
-
hasNext
boolean hasNext()
- Returns:
- true if there pending messages to dispatch
-
next
org.apache.activemq.broker.region.MessageReference next()
- Returns:
- the next pending message with its reference count increment
-
remove
void remove()
remove the message at the cursor position
-
size
int size()
- Returns:
- the number of pending messages
-
messageSize
long messageSize()
-
clear
void clear()
clear all pending messages
-
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
-
getMaxBatchSize
int getMaxBatchSize()
- Returns:
- the maximum batch size
-
setMaxBatchSize
void setMaxBatchSize(int maxBatchSize)
Set the max batch size- Parameters:
maxBatchSize-
-
resetForGC
void resetForGC()
Give the cursor a hint that we are about to remove messages from memory only
-
remove
void remove(org.apache.activemq.broker.region.MessageReference node)
remove a node- Parameters:
node-
-
gc
void gc()
free up any internal buffers
-
setSystemUsage
void setSystemUsage(SystemUsage systemUsage)
Set the UsageManager- Parameters:
systemUsage-- See Also:
SystemUsage
-
getSystemUsage
SystemUsage getSystemUsage()
- Returns:
- the usageManager
-
getMemoryUsageHighWaterMark
int getMemoryUsageHighWaterMark()
- Returns:
- the memoryUsageHighWaterMark
-
setMemoryUsageHighWaterMark
void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)
- Parameters:
memoryUsageHighWaterMark- the memoryUsageHighWaterMark to set
-
isFull
boolean isFull()
- Returns:
- true if the cursor is full
-
hasSpace
boolean hasSpace()
- Returns:
- true if the cursor has space to page messages into
-
hasMessagesBufferedToDeliver
boolean hasMessagesBufferedToDeliver()
- Returns:
- true if the cursor has buffered messages ready to deliver
-
pageInList
LinkedList<org.apache.activemq.broker.region.MessageReference> pageInList(int maxItems)
Page in a restricted number of messages and increment the reference count- Parameters:
maxItems-- Returns:
- a list of paged in messages
-
setMaxProducersToAudit
void setMaxProducersToAudit(int value)
set the maximum number of producers to track at one time- Parameters:
value-
-
getMaxProducersToAudit
int getMaxProducersToAudit()
- Returns:
- the maximum number of producers to audit
-
setMaxAuditDepth
void setMaxAuditDepth(int depth)
Set the maximum depth of message ids to track- Parameters:
depth-
-
getMaxAuditDepth
int getMaxAuditDepth()
- Returns:
- the audit depth
-
isEnableAudit
boolean isEnableAudit()
- Returns:
- the enableAudit
-
setEnableAudit
void setEnableAudit(boolean enableAudit)
- Parameters:
enableAudit- the enableAudit to set
-
isTransient
boolean isTransient()
- Returns:
- true if the underlying state of this cursor disappears when the broker shuts down
-
setMessageAudit
void setMessageAudit(org.apache.activemq.ActiveMQMessageAudit audit)
set the audit- Parameters:
audit-
-
getMessageAudit
org.apache.activemq.ActiveMQMessageAudit getMessageAudit()
- Returns:
- the audit - could be null
-
setUseCache
void setUseCache(boolean useCache)
use a cache to improve performance- Parameters:
useCache-
-
isUseCache
boolean isUseCache()
- Returns:
- true if a cache may be used
-
rollback
void rollback(org.apache.activemq.command.MessageId id)
remove from auditing the message id- Parameters:
id-
-
isCacheEnabled
boolean isCacheEnabled()
- Returns:
- true if cache is being used
-
rebase
void rebase()
-
-