Class MessageAck

    • Field Detail

      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • ackType

        protected byte ackType
      • firstMessageId

        protected MessageId firstMessageId
      • lastMessageId

        protected MessageId lastMessageId
      • messageCount

        protected int messageCount
      • poisonCause

        protected Throwable poisonCause
      • consumerKey

        protected transient String consumerKey
    • Constructor Detail

      • MessageAck

        public MessageAck()
      • MessageAck

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

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

      • getDataStructureType

        public byte getDataStructureType()
        Returns:
        The type of the data structure
      • 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()
      • 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)
      • setMessageID

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