Package org.apache.activemq.command
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 Summary
Fields Modifier and Type Field Description protected byte
ackType
protected ConsumerId
consumerId
protected String
consumerKey
static byte
DATA_STRUCTURE_TYPE
static byte
DELIVERED_ACK_TYPE
Used to let the broker know that the message has been delivered to the client.protected ActiveMQDestination
destination
static byte
EXPIRED_ACK_TYPE
the case where a consumer does not dispatch because message has expired inflightprotected MessageId
firstMessageId
static byte
INDIVIDUAL_ACK_TYPE
The ack case where a client wants only an individual message to be discarded.protected MessageId
lastMessageId
protected int
messageCount
static 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.protected Throwable
poisonCause
static 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.static byte
STANDARD_ACK_TYPE
The standard ack case where a client wants the message to be discarded.protected TransactionId
transactionId
static byte
UNMATCHED_ACK_TYPE
The ack case where a durable topic subscription does not match a selector.-
Fields inherited from class org.apache.activemq.command.BaseCommand
commandId, responseRequired
-
-
Constructor Summary
Constructors Constructor Description MessageAck()
MessageAck(MessageDispatch md, byte ackType, int messageCount)
MessageAck(Message message, byte ackType, int messageCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copy(MessageAck copy)
byte
getAckType()
ConsumerId
getConsumerId()
byte
getDataStructureType()
ActiveMQDestination
getDestination()
MessageId
getFirstMessageId()
MessageId
getLastMessageId()
int
getMessageCount()
The number of messages being acknowledged in the range.Throwable
getPoisonCause()
The cause of a poison ack, if a message listener throws an exception it will be recorded hereTransactionId
getTransactionId()
boolean
isDeliveredAck()
boolean
isExpiredAck()
boolean
isIndividualAck()
boolean
isInTransaction()
boolean
isMessageAck()
boolean
isPoisonAck()
boolean
isRedeliveredAck()
boolean
isStandardAck()
boolean
isUnmatchedAck()
void
setAckType(byte ackType)
void
setConsumerId(ConsumerId consumerId)
void
setDestination(ActiveMQDestination destination)
void
setFirstMessageId(MessageId firstMessageId)
void
setLastMessageId(MessageId lastMessageId)
void
setMessageCount(int messageCount)
void
setMessageID(MessageId messageID)
A helper method to allow a single message ID to be acknowledgedvoid
setPoisonCause(Throwable poisonCause)
void
setTransactionId(TransactionId transactionId)
Response
visit(CommandVisitor visitor)
-
Methods inherited from class org.apache.activemq.command.BaseCommand
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isConsumerControl, isMarshallAware, isMessage, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo, toString, toString
-
-
-
-
Field Detail
-
DATA_STRUCTURE_TYPE
public static final byte DATA_STRUCTURE_TYPE
- See Also:
- Constant Field Values
-
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
-
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 Detail
-
MessageAck
public MessageAck()
-
MessageAck
public MessageAck(MessageDispatch md, byte ackType, int messageCount)
-
MessageAck
public MessageAck(Message message, byte ackType, int messageCount)
-
-
Method Detail
-
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 interfaceCommand
- Overrides:
isMessageAck
in classBaseCommand
-
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
-
-