org.apache.activemq.command
Class MessageAck

java.lang.Object
  extended by org.apache.activemq.command.BaseCommand
      extended by org.apache.activemq.command.MessageAck
All Implemented Interfaces:
Command, DataStructure
Direct Known Subclasses:
MessageAckWithLocation

public class MessageAck
extends BaseCommand


Field Summary
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
           
protected  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
           
protected  Throwable poisonCause
           
static byte POSION_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.
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
MessageAck()
           
MessageAck(Message message, byte ackType, int messageCount)
           
MessageAck(MessageDispatch md, byte ackType, int messageCount)
           
 
Method Summary
 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 here
 TransactionId getTransactionId()
           
 boolean isDeliveredAck()
           
 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 acknowledged
 void 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, isMarshallAware, isMessage, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

POSION_ACK_TYPE

public static final byte POSION_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

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 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()

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



Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.