Interface PendingMessageCursor
-
- All Superinterfaces:
Service
- All Known Implementing Classes:
AbstractPendingMessageCursor
,AbstractStoreCursor
,FilePendingMessageCursor
,StoreDurableSubscriberCursor
,StoreQueueCursor
,VMPendingMessageCursor
public interface PendingMessageCursor extends Service
Interface to pending message (messages awaiting disptach to a consumer) cursor
-
-
Field Summary
Fields Modifier and Type Field Description static long
INFINITE_WAIT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(ConnectionContext context, Destination destination)
Add a destinationvoid
addMessageFirst(MessageReference node)
add message to await dispatchboolean
addMessageLast(MessageReference node)
add message to await dispatchvoid
addRecoveredMessage(MessageReference node)
Add a message recovered from a retroactive policyvoid
clear()
clear all pending messagesvoid
destroy()
destroy the cursorvoid
gc()
free up any internal buffersint
getMaxAuditDepth()
int
getMaxBatchSize()
int
getMaxProducersToAudit()
int
getMemoryUsageHighWaterMark()
ActiveMQMessageAudit
getMessageAudit()
SystemUsage
getSystemUsage()
boolean
hasMessagesBufferedToDeliver()
boolean
hasNext()
boolean
hasSpace()
boolean
isCacheEnabled()
boolean
isEmpty()
boolean
isEmpty(Destination destination)
check if a Destination is Empty for this cursorboolean
isEnableAudit()
boolean
isFull()
boolean
isRecoveryRequired()
Informs the Broker if the subscription needs to intervention to recover it's state e.g.boolean
isTransient()
boolean
isUseCache()
long
messageSize()
MessageReference
next()
LinkedList<MessageReference>
pageInList(int maxItems)
Page in a restricted number of messages and increment the reference countvoid
rebase()
void
release()
hint to the cursor to release any locks it might have grabbed after a resetvoid
remove()
remove the message at the cursor positionList<MessageReference>
remove(ConnectionContext context, Destination destination)
remove a destinationvoid
remove(MessageReference node)
remove a nodevoid
reset()
reset the cursorvoid
resetForGC()
Give the cursor a hint that we are about to remove messages from memory onlyvoid
rollback(MessageId id)
remove from auditing the message idvoid
setEnableAudit(boolean enableAudit)
void
setMaxAuditDepth(int depth)
Set the maximum depth of message ids to trackvoid
setMaxBatchSize(int maxBatchSize)
Set the max batch sizevoid
setMaxProducersToAudit(int value)
set the maximum number of producers to track at one timevoid
setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)
void
setMessageAudit(ActiveMQMessageAudit audit)
set the auditvoid
setSystemUsage(SystemUsage systemUsage)
Set the UsageManagervoid
setUseCache(boolean useCache)
use a cache to improve performanceint
size()
boolean
tryAddMessageLast(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<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(MessageReference node) throws Exception
add message to await dispatch- Parameters:
node
-- Returns:
- boolean true if successful, false if cursor traps a duplicate
- Throws:
IOException
Exception
-
tryAddMessageLast
boolean tryAddMessageLast(MessageReference node, long maxWaitTime) throws Exception
add message to await dispatch - if it can- Parameters:
node
-maxWaitTime
-- Returns:
- true if successful
- Throws:
IOException
Exception
-
addMessageFirst
void addMessageFirst(MessageReference node) throws Exception
add message to await dispatch- Parameters:
node
-- Throws:
Exception
-
addRecoveredMessage
void addRecoveredMessage(MessageReference node) throws Exception
Add a message recovered from a retroactive policy- Parameters:
node
-- Throws:
Exception
-
hasNext
boolean hasNext()
- Returns:
- true if there pending messages to dispatch
-
next
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(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<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(ActiveMQMessageAudit audit)
set the audit- Parameters:
audit
-
-
getMessageAudit
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(MessageId id)
remove from auditing the message id- Parameters:
id
-
-
isCacheEnabled
boolean isCacheEnabled()
- Returns:
- true if cache is being used
-
rebase
void rebase()
-
-