Class MemoryMessageStore

    • Field Detail

      • messageTable

        protected final Map<org.apache.activemq.command.MessageId,​org.apache.activemq.command.Message> messageTable
      • lastBatchId

        protected org.apache.activemq.command.MessageId lastBatchId
      • sequenceId

        protected long sequenceId
    • Constructor Detail

      • MemoryMessageStore

        public MemoryMessageStore​(org.apache.activemq.command.ActiveMQDestination destination)
      • MemoryMessageStore

        public MemoryMessageStore​(org.apache.activemq.command.ActiveMQDestination destination,
                                  Map<org.apache.activemq.command.MessageId,​org.apache.activemq.command.Message> messageTable)
    • Method Detail

      • addMessage

        public void addMessage​(ConnectionContext context,
                               org.apache.activemq.command.Message message)
                        throws IOException
        Description copied from interface: MessageStore
        Adds a message to the message store
        Parameters:
        context - context
        Throws:
        IOException
      • getMessage

        public org.apache.activemq.command.Message getMessage​(org.apache.activemq.command.MessageId identity)
                                                       throws IOException
        Description copied from interface: MessageStore
        Looks up a message using either the String messageID or the messageNumber. Implementations are encouraged to fill in the missing key if its easy to do so.
        Parameters:
        identity - which contains either the messageID or the messageNumber
        Returns:
        the message or null if it does not exist
        Throws:
        IOException
      • removeMessage

        public void removeMessage​(ConnectionContext context,
                                  org.apache.activemq.command.MessageAck ack)
                           throws IOException
        Description copied from interface: MessageStore
        Removes a message from the message store.
        ack - the ack request that cause the message to be removed. It conatins the identity which contains the messageID of the message that needs to be removed.
        Throws:
        IOException
      • removeMessage

        public void removeMessage​(org.apache.activemq.command.MessageId msgId)
                           throws IOException
        Throws:
        IOException
      • delete

        public void delete()
      • resetBatching

        public void resetBatching()
        Description copied from interface: MessageStore
        A hint to the Store to reset any batching state for the Destination
      • setBatch

        public void setBatch​(org.apache.activemq.command.MessageId messageId)
        Description copied from interface: MessageStore
        allow caching cursors to set the current batch offset when cache is exhausted
        Specified by:
        setBatch in interface MessageStore
        Overrides:
        setBatch in class AbstractMessageStore
      • incMessageStoreStatistics

        protected static final void incMessageStoreStatistics​(MessageStoreStatistics stats,
                                                              org.apache.activemq.command.Message message)
      • decMessageStoreStatistics

        protected static final void decMessageStoreStatistics​(MessageStoreStatistics stats,
                                                              org.apache.activemq.command.Message message)