Package org.apache.activemq
Class ActiveMQMessageAuditNoSync
java.lang.Object
org.apache.activemq.ActiveMQMessageAuditNoSync
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ActiveMQMessageAudit
Provides basic audit functions for Messages without sync
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor windowSize = 2048, maximumNumberOfProducersToTrack = 64ActiveMQMessageAuditNoSync(int auditDepth, int maximumNumberOfProducersToTrack) Construct a MessageAudit -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()intlongintbooleanisDuplicate(jakarta.jms.Message message) Checks if this message has been seen beforebooleanisDuplicate(String id) checks whether this messageId has been seen before and adds this messageId to the listbooleanisDuplicate(MessageReference message) Checks if this message has been seen beforebooleanisDuplicate(MessageId id) Checks if this messageId has been seen beforebooleanisInOrder(jakarta.jms.Message msg) Check the message is in orderbooleanCheck the message id is in orderbooleanisInOrder(MessageReference message) Check the MessageId is in orderbooleanCheck the MessageId is in orderbooleanReturns if the Audit has been modified since last check, this method does not reset the modified flag.booleanmodified()Reads and returns the current modified state of the Audit, once called the state is reset to false.voidvoidrollback(MessageReference message) mark this message as being receivedvoidmark this message as being receivedvoidsetAuditDepth(int auditDepth) voidsetMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) voidsetModified(boolean modified)
-
Field Details
-
DEFAULT_WINDOW_SIZE
public static final int DEFAULT_WINDOW_SIZE- See Also:
-
MAXIMUM_PRODUCER_COUNT
public static final int MAXIMUM_PRODUCER_COUNT- See Also:
-
-
Constructor Details
-
ActiveMQMessageAuditNoSync
public ActiveMQMessageAuditNoSync()Default Constructor windowSize = 2048, maximumNumberOfProducersToTrack = 64 -
ActiveMQMessageAuditNoSync
public ActiveMQMessageAuditNoSync(int auditDepth, int maximumNumberOfProducersToTrack) Construct a MessageAudit- Parameters:
auditDepth- range of ids to trackmaximumNumberOfProducersToTrack- number of producers expected in the system
-
-
Method Details
-
getAuditDepth
public int getAuditDepth()- Returns:
- the auditDepth
-
setAuditDepth
public void setAuditDepth(int auditDepth) - Parameters:
auditDepth- the auditDepth to set
-
getMaximumNumberOfProducersToTrack
public int getMaximumNumberOfProducersToTrack()- Returns:
- the maximumNumberOfProducersToTrack
-
setMaximumNumberOfProducersToTrack
public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack) - Parameters:
maximumNumberOfProducersToTrack- the maximumNumberOfProducersToTrack to set
-
isDuplicate
public boolean isDuplicate(jakarta.jms.Message message) throws jakarta.jms.JMSException Checks if this message has been seen before- Parameters:
message-- Returns:
- true if the message is a duplicate
- Throws:
jakarta.jms.JMSException
-
isDuplicate
checks whether this messageId has been seen before and adds this messageId to the list- Parameters:
id-- Returns:
- true if the message is a duplicate
-
isDuplicate
Checks if this message has been seen before- Parameters:
message-- Returns:
- true if the message is a duplicate
-
isDuplicate
Checks if this messageId has been seen before- Parameters:
id-- Returns:
- true if the message is a duplicate
-
rollback
mark this message as being received- Parameters:
message-
-
rollback
mark this message as being received- Parameters:
id-
-
rollback
-
isInOrder
public boolean isInOrder(jakarta.jms.Message msg) throws jakarta.jms.JMSException Check the message is in order- Parameters:
msg-- Returns:
- true if the id is in order
- Throws:
jakarta.jms.JMSException
-
isInOrder
Check the message id is in order- Parameters:
id-- Returns:
- true if the id is in order
-
isInOrder
Check the MessageId is in order- Parameters:
message-- Returns:
- true if the id is in order
-
isInOrder
Check the MessageId is in order- Parameters:
id-- Returns:
- true if the id is in order
-
getLastSeqId
-
clear
public void clear() -
isModified
public boolean isModified()Returns if the Audit has been modified since last check, this method does not reset the modified flag. If the caller needs to reset the flag in order to avoid serializing an unchanged Audit then its up the them to reset it themselves.- Returns:
- true if the Audit has been modified.
-
setModified
public void setModified(boolean modified) -
modified
public boolean modified()Reads and returns the current modified state of the Audit, once called the state is reset to false. This method is useful for code the needs to know if it should write out the Audit or otherwise execute some logic based on the Audit having changed since last check.- Returns:
- true if the Audit has been modified since last check.
-