Interface MessageReference

All Known Subinterfaces:
PagedReference
All Known Implementing Classes:
AbstractProtocolReference, GroupFirstMessageReference, MessageReferenceImpl, PagedReferenceImpl, QueryPagedReferenceImpl

public interface MessageReference
A reference to a message.

Channels store message references rather than the messages themselves.

  • Method Details

    • skipDelivery

      default boolean skipDelivery()
    • isPaged

      boolean isPaged()
    • getMessage

      Message getMessage()
    • getMessageID

      long getMessageID()
    • isDurable

      boolean isDurable()
    • getLastValueProperty

      SimpleString getLastValueProperty()
    • onDelivery

      void onDelivery(Consumer<? super MessageReference> callback)
      This is to be used in cases where a message delivery happens on an executor. Most MessageReference implementations will allow execution, and if it does, and the protocol requires an execution per message, this callback may be used.

      At the time of this implementation only AMQP was used.

    • getMessageMemoryEstimate

      int getMessageMemoryEstimate()
      We define this method aggregation here because on paging we need to hold the original estimate, so we need to perform some extra steps on paging.
    • getProtocolData

      <T> T getProtocolData(Class<T> typeClass)
      To be used on holding protocol specific data during the delivery. This will be only valid while the message is on the delivering queue at the consumer
    • setProtocolData

      <T> void setProtocolData(Class<T> typeClass, T data)
      To be used on holding protocol specific data during the delivery. This will be only valid while the message is on the delivering queue at the consumer
    • copy

      MessageReference copy(Queue queue)
    • getScheduledDeliveryTime

      long getScheduledDeliveryTime()
      Returns The time in the future that delivery will be delayed until, or zero if no scheduled delivery will occur.
      Returns:
      The time in the future that delivery will be delayed until, or zero if no scheduled delivery will occur
    • setScheduledDeliveryTime

      void setScheduledDeliveryTime(long scheduledDeliveryTime)
    • getDeliveryCount

      int getDeliveryCount()
    • setDeliveryCount

      void setDeliveryCount(int deliveryCount)
    • setPersistedCount

      void setPersistedCount(int deliveryCount)
    • getPersistedCount

      int getPersistedCount()
    • incrementDeliveryCount

      void incrementDeliveryCount()
    • decrementDeliveryCount

      void decrementDeliveryCount()
    • getQueue

      Queue getQueue()
    • acknowledge

      void acknowledge() throws Exception
      Throws:
      Exception
    • acknowledge

      void acknowledge(Transaction tx) throws Exception
      Throws:
      Exception
    • acknowledge

      void acknowledge(Transaction tx, ServerConsumer consumer) throws Exception
      Throws:
      Exception
    • acknowledge

      void acknowledge(Transaction tx, AckReason reason, ServerConsumer consumer) throws Exception
      Throws:
      Exception
    • acknowledge

      void acknowledge(Transaction tx, AckReason reason, ServerConsumer consumer, boolean delivering) throws Exception
      Throws:
      Exception
    • emptyConsumerID

      void emptyConsumerID()
    • setConsumerId

      void setConsumerId(long consumerID)
    • hasConsumerId

      boolean hasConsumerId()
    • getConsumerId

      long getConsumerId()
    • handled

      void handled()
    • setInDelivery

      void setInDelivery(boolean alreadyDelivered)
    • isInDelivery

      boolean isInDelivery()
    • setAlreadyAcked

      void setAlreadyAcked()
    • isAlreadyAcked

      boolean isAlreadyAcked()
    • getPersistentSize

      long getPersistentSize() throws ActiveMQException
      This is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking for the amount of data on a queue
      Throws:
      ActiveMQException
    • getSequence

      long getSequence()
    • setSequence

      void setSequence(long nextSequence)