Class MessageAck

java.lang.Object
org.apache.activemq.command.BaseCommand
org.apache.activemq.command.MessageAck
All Implemented Interfaces:
Command, DataStructure

public class MessageAck extends BaseCommand
  • Field Details

    • DATA_STRUCTURE_TYPE

      public static final byte DATA_STRUCTURE_TYPE
      See Also:
    • DELIVERED_ACK_TYPE

      public static final byte DELIVERED_ACK_TYPE
      Used to let the broker know that the message has been delivered to the client. Message will still be retained until an standard ack is received. This is used get the broker to send more messages past prefetch limits when an standard ack has not been sent.
      See Also:
    • STANDARD_ACK_TYPE

      public static final byte STANDARD_ACK_TYPE
      The standard ack case where a client wants the message to be discarded.
      See Also:
    • POISON_ACK_TYPE

      public static final byte POISON_ACK_TYPE
      In case the client want's to explicitly let the broker know that a message was not processed and the message was considered a poison message.
      See Also:
    • REDELIVERED_ACK_TYPE

      public static final byte REDELIVERED_ACK_TYPE
      In case the client want's to explicitly let the broker know that a message was not processed and it was re-delivered to the consumer but it was not yet considered to be a poison message. The messageCount field will hold the number of times the message was re-delivered.
      See Also:
    • INDIVIDUAL_ACK_TYPE

      public static final byte INDIVIDUAL_ACK_TYPE
      The ack case where a client wants only an individual message to be discarded.
      See Also:
    • UNMATCHED_ACK_TYPE

      public static final byte UNMATCHED_ACK_TYPE
      The ack case where a durable topic subscription does not match a selector.
      See Also:
    • EXPIRED_ACK_TYPE

      public static final byte EXPIRED_ACK_TYPE
      the case where a consumer does not dispatch because message has expired inflight
      See Also:
    • ackType

      protected byte ackType
    • consumerId

      protected ConsumerId consumerId
    • firstMessageId

      protected MessageId firstMessageId
    • lastMessageId

      protected MessageId lastMessageId
    • destination

      protected ActiveMQDestination destination
    • transactionId

      protected TransactionId transactionId
    • messageCount

      protected int messageCount
    • poisonCause

      protected Throwable poisonCause
    • consumerKey

      protected transient String consumerKey
  • Constructor Details

    • MessageAck

      public MessageAck()
    • MessageAck

      public MessageAck(MessageDispatch md, byte ackType, int messageCount)
    • MessageAck

      public MessageAck(Message message, byte ackType, int messageCount)
  • Method Details

    • copy

      public void copy(MessageAck copy)
    • getDataStructureType

      public byte getDataStructureType()
      Returns:
      The type of the data structure
    • isMessageAck

      public boolean isMessageAck()
      Specified by:
      isMessageAck in interface Command
      Overrides:
      isMessageAck in class BaseCommand
    • isPoisonAck

      public boolean isPoisonAck()
    • isStandardAck

      public boolean isStandardAck()
    • isDeliveredAck

      public boolean isDeliveredAck()
    • isRedeliveredAck

      public boolean isRedeliveredAck()
    • isIndividualAck

      public boolean isIndividualAck()
    • isUnmatchedAck

      public boolean isUnmatchedAck()
    • isExpiredAck

      public boolean isExpiredAck()
    • getDestination

      public ActiveMQDestination getDestination()
    • setDestination

      public void setDestination(ActiveMQDestination destination)
    • getTransactionId

      public TransactionId getTransactionId()
    • setTransactionId

      public void setTransactionId(TransactionId transactionId)
    • isInTransaction

      public boolean isInTransaction()
    • getConsumerId

      public ConsumerId getConsumerId()
    • setConsumerId

      public void setConsumerId(ConsumerId consumerId)
    • getAckType

      public byte getAckType()
    • setAckType

      public void setAckType(byte ackType)
    • getFirstMessageId

      public MessageId getFirstMessageId()
    • setFirstMessageId

      public void setFirstMessageId(MessageId firstMessageId)
    • getLastMessageId

      public MessageId getLastMessageId()
    • setLastMessageId

      public void setLastMessageId(MessageId lastMessageId)
    • getMessageCount

      public int getMessageCount()
      The number of messages being acknowledged in the range.
    • setMessageCount

      public void setMessageCount(int messageCount)
    • getPoisonCause

      public Throwable getPoisonCause()
      The cause of a poison ack, if a message listener throws an exception it will be recorded here
    • setPoisonCause

      public void setPoisonCause(Throwable poisonCause)
    • visit

      public Response visit(CommandVisitor visitor) throws Exception
      Throws:
      Exception
    • setMessageID

      public void setMessageID(MessageId messageID)
      A helper method to allow a single message ID to be acknowledged