Class ActiveMQMessageAuditNoSync

    • Constructor Detail

      • 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 track
        maximumNumberOfProducersToTrack - number of producers expected in the system
    • Method Detail

      • 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​(Message message)
                            throws JMSException
        Checks if this message has been seen before
        Parameters:
        message -
        Returns:
        true if the message is a duplicate
        Throws:
        JMSException
      • isDuplicate

        public boolean isDuplicate​(String id)
        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

        public boolean isDuplicate​(MessageReference message)
        Checks if this message has been seen before
        Parameters:
        message -
        Returns:
        true if the message is a duplicate
      • isDuplicate

        public boolean isDuplicate​(MessageId id)
        Checks if this messageId has been seen before
        Parameters:
        id -
        Returns:
        true if the message is a duplicate
      • rollback

        public void rollback​(MessageReference message)
        mark this message as being received
        Parameters:
        message -
      • rollback

        public void rollback​(MessageId id)
        mark this message as being received
        Parameters:
        id -
      • rollback

        public void rollback​(String id)
      • isInOrder

        public boolean isInOrder​(Message msg)
                          throws JMSException
        Check the message is in order
        Parameters:
        msg -
        Returns:
        true if the id is in order
        Throws:
        JMSException
      • isInOrder

        public boolean isInOrder​(String id)
        Check the message id is in order
        Parameters:
        id -
        Returns:
        true if the id is in order
      • isInOrder

        public boolean isInOrder​(MessageReference message)
        Check the MessageId is in order
        Parameters:
        message -
        Returns:
        true if the id is in order
      • isInOrder

        public boolean isInOrder​(MessageId id)
        Check the MessageId is in order
        Parameters:
        id -
        Returns:
        true if the id is in order
      • getLastSeqId

        public long getLastSeqId​(ProducerId id)
      • 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.