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.Service
Interface to pending message (messages awaiting disptach to a consumer)
cursor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(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 buffersintintintintorg.apache.activemq.ActiveMQMessageAuditbooleanbooleanhasNext()booleanhasSpace()booleanbooleanisEmpty()booleanisEmpty(Destination destination) check if a Destination is Empty for this cursorbooleanbooleanisFull()booleanInforms the Broker if the subscription needs to intervention to recover it's state e.g.booleanbooleanlongorg.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 cursorvoidGive 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 canMethods inherited from interface org.apache.activemq.Service
start, stop
-
Field Details
-
INFINITE_WAIT
static final long INFINITE_WAIT- See Also:
-
-
Method Details
-
add
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
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
add 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 Exception add message to await dispatch - if it can- Parameters:
node-maxWaitTime-- Returns:
- true if successful
- Throws:
IOExceptionException
-
addMessageFirst
add message to await dispatch- Parameters:
node-- Throws:
Exception
-
addRecoveredMessage
Add 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
Set the UsageManager- Parameters:
systemUsage-- See Also:
-
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
-
destroy
destroy the cursor- Throws:
Exception
-
pageInList
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()
-