Interface MessageReference
- All Known Subinterfaces:
PagedReference
- All Known Implementing Classes:
AbstractProtocolReference,GroupFirstMessageReference,MessageReferenceImpl,PagedReferenceImpl,QueryPagedReferenceImpl
public interface MessageReference
A reference to a message.
Channels store message references rather than the messages themselves.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidacknowledge(Transaction tx, AckReason reason, ServerConsumer consumer) voidacknowledge(Transaction tx, AckReason reason, ServerConsumer consumer, boolean delivering) voidacknowledge(Transaction tx, ServerConsumer consumer) voidvoidlongintlongintWe define this method aggregation here because on paging we need to hold the original estimate, so we need to perform some extra steps on paging.intlongThis is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking for the amount of data on a queue<T> TgetProtocolData(Class<T> typeClass) To be used on holding protocol specific data during the delivery.getQueue()longReturns The time in the future that delivery will be delayed until, or zero if no scheduled delivery will occur.longvoidhandled()booleanvoidbooleanbooleanbooleanbooleanisPaged()voidonDelivery(Consumer<? super MessageReference> callback) This is to be used in cases where a message delivery happens on an executor.voidvoidsetConsumerId(long consumerID) voidsetDeliveryCount(int deliveryCount) voidsetInDelivery(boolean alreadyDelivered) voidsetPersistedCount(int deliveryCount) <T> voidsetProtocolData(Class<T> typeClass, T data) To be used on holding protocol specific data during the delivery.voidsetScheduledDeliveryTime(long scheduledDeliveryTime) voidsetSequence(long nextSequence) default boolean
-
Method Details
-
skipDelivery
default boolean skipDelivery() -
isPaged
boolean isPaged() -
getMessage
Message getMessage() -
getMessageID
long getMessageID() -
isDurable
boolean isDurable() -
getLastValueProperty
SimpleString getLastValueProperty() -
onDelivery
This is to be used in cases where a message delivery happens on an executor. Most MessageReference implementations will allow execution, and if it does, and the protocol requires an execution per message, this callback may be used.At the time of this implementation only AMQP was used.
-
getMessageMemoryEstimate
int getMessageMemoryEstimate()We define this method aggregation here because on paging we need to hold the original estimate, so we need to perform some extra steps on paging. -
getProtocolData
To be used on holding protocol specific data during the delivery. This will be only valid while the message is on the delivering queue at the consumer -
setProtocolData
To be used on holding protocol specific data during the delivery. This will be only valid while the message is on the delivering queue at the consumer -
copy
-
getScheduledDeliveryTime
long getScheduledDeliveryTime()Returns The time in the future that delivery will be delayed until, or zero if no scheduled delivery will occur.- Returns:
- The time in the future that delivery will be delayed until, or zero if no scheduled delivery will occur
-
setScheduledDeliveryTime
void setScheduledDeliveryTime(long scheduledDeliveryTime) -
getDeliveryCount
int getDeliveryCount() -
setDeliveryCount
void setDeliveryCount(int deliveryCount) -
setPersistedCount
void setPersistedCount(int deliveryCount) -
getPersistedCount
int getPersistedCount() -
incrementDeliveryCount
void incrementDeliveryCount() -
decrementDeliveryCount
void decrementDeliveryCount() -
getQueue
Queue getQueue() -
acknowledge
- Throws:
Exception
-
acknowledge
- Throws:
Exception
-
acknowledge
- Throws:
Exception
-
acknowledge
- Throws:
Exception
-
acknowledge
void acknowledge(Transaction tx, AckReason reason, ServerConsumer consumer, boolean delivering) throws Exception - Throws:
Exception
-
emptyConsumerID
void emptyConsumerID() -
setConsumerId
void setConsumerId(long consumerID) -
hasConsumerId
boolean hasConsumerId() -
getConsumerId
long getConsumerId() -
handled
void handled() -
setInDelivery
void setInDelivery(boolean alreadyDelivered) -
isInDelivery
boolean isInDelivery() -
setAlreadyAcked
void setAlreadyAcked() -
isAlreadyAcked
boolean isAlreadyAcked() -
getPersistentSize
This is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking for the amount of data on a queue- Throws:
ActiveMQException
-
getSequence
long getSequence() -
setSequence
void setSequence(long nextSequence)
-