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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte
protected ConsumerId
protected String
static final byte
static final byte
Used to let the broker know that the message has been delivered to the client.protected ActiveMQDestination
static final byte
the case where a consumer does not dispatch because message has expired inflightprotected MessageId
static final byte
The ack case where a client wants only an individual message to be discarded.protected MessageId
protected int
static final byte
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
static final byte
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 final byte
The standard ack case where a client wants the message to be discarded.protected TransactionId
static final byte
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
ConstructorsConstructorDescriptionMessageAck
(MessageDispatch md, byte ackType, int messageCount) MessageAck
(Message message, byte ackType, int messageCount) -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(MessageAck copy) byte
byte
int
The number of messages being acknowledged in the range.The cause of a poison ack, if a message listener throws an exception it will be recorded hereboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
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) 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 Details
-
DATA_STRUCTURE_TYPE
public static final byte DATA_STRUCTURE_TYPE- See Also:
-
DELIVERED_ACK_TYPE
public static final byte DELIVERED_ACK_TYPEUsed 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_TYPEThe standard ack case where a client wants the message to be discarded.- See Also:
-
POISON_ACK_TYPE
public static final byte POISON_ACK_TYPEIn 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_TYPEIn 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_TYPEThe ack case where a client wants only an individual message to be discarded.- See Also:
-
UNMATCHED_ACK_TYPE
public static final byte UNMATCHED_ACK_TYPEThe ack case where a durable topic subscription does not match a selector.- See Also:
-
EXPIRED_ACK_TYPE
public static final byte EXPIRED_ACK_TYPEthe case where a consumer does not dispatch because message has expired inflight- See Also:
-
ackType
protected byte ackType -
consumerId
-
firstMessageId
-
lastMessageId
-
destination
-
transactionId
-
messageCount
protected int messageCount -
poisonCause
-
consumerKey
-
-
Constructor Details
-
MessageAck
public MessageAck() -
MessageAck
-
MessageAck
-
-
Method Details
-
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
-
setDestination
-
getTransactionId
-
setTransactionId
-
isInTransaction
public boolean isInTransaction() -
getConsumerId
-
setConsumerId
-
getAckType
public byte getAckType() -
setAckType
public void setAckType(byte ackType) -
getFirstMessageId
-
setFirstMessageId
-
getLastMessageId
-
setLastMessageId
-
getMessageCount
public int getMessageCount()The number of messages being acknowledged in the range. -
setMessageCount
public void setMessageCount(int messageCount) -
getPoisonCause
The cause of a poison ack, if a message listener throws an exception it will be recorded here -
setPoisonCause
-
visit
- Throws:
Exception
-
setMessageID
A helper method to allow a single message ID to be acknowledged
-