Class MarkAsDeadLetterMessage
- java.lang.Object
-
- dk.cloudcreate.essentials.components.foundation.messaging.queue.operations.MarkAsDeadLetterMessage
-
public class MarkAsDeadLetterMessage extends Object
Mark an already Queued Message as a Dead Letter Message (or Poison Message).
Dead Letter Messages won't be delivered to anyDurableQueueConsumer(called by theDurableQueueConsumer)
To deliver a Dead Letter Message you must first resurrect the message usingDurableQueues.resurrectDeadLetterMessage(QueueEntryId, Duration)
Note this method MUST be called within an existingUnitOfWorkIF usingTransactionalMode.FullyTransactional
Operation also matchesDurableQueuesInterceptor.intercept(MarkAsDeadLetterMessage, InterceptorChain)
-
-
Field Summary
Fields Modifier and Type Field Description QueueEntryIdqueueEntryId
-
Constructor Summary
Constructors Constructor Description MarkAsDeadLetterMessage(QueueEntryId queueEntryId, Exception causeForBeingMarkedAsDeadLetter)Mark a Message as a Dead Letter Message (or Poison Message).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MarkAsDeadLetterMessageBuilderbuilder()Create a new builder that produces a newMarkAsDeadLetterMessageinstanceExceptiongetCauseForBeingMarkedAsDeadLetter()QueueEntryIdgetQueueEntryId()voidsetCauseForBeingMarkedAsDeadLetter(Exception causeForBeingMarkedAsDeadLetter)StringtoString()voidvalidate()
-
-
-
Field Detail
-
queueEntryId
public final QueueEntryId queueEntryId
-
-
Constructor Detail
-
MarkAsDeadLetterMessage
public MarkAsDeadLetterMessage(QueueEntryId queueEntryId, Exception causeForBeingMarkedAsDeadLetter)
Mark a Message as a Dead Letter Message (or Poison Message). Dead Letter Messages won't be delivered to anyDurableQueueConsumer(called by theDurableQueueConsumer)
To deliver a Dead Letter Message you must first resurrect the message usingDurableQueues.resurrectDeadLetterMessage(QueueEntryId, Duration)
Note this method MUST be called within an existingUnitOfWorkIF usingTransactionalMode.FullyTransactional- Parameters:
queueEntryId- the unique id of the message that must be marked as a Dead Letter MessagecauseForBeingMarkedAsDeadLetter- the reason for the message being marked as a Dead Letter Message
-
-
Method Detail
-
builder
public static MarkAsDeadLetterMessageBuilder builder()
Create a new builder that produces a newMarkAsDeadLetterMessageinstance- Returns:
- a new
MarkAsDeadLetterMessageBuilderinstance
-
getQueueEntryId
public QueueEntryId getQueueEntryId()
- Returns:
- the unique id of the message that must be marked as a Dead Letter Message
-
getCauseForBeingMarkedAsDeadLetter
public Exception getCauseForBeingMarkedAsDeadLetter()
- Returns:
- the reason for the message being marked as a Dead Letter Message
-
setCauseForBeingMarkedAsDeadLetter
public void setCauseForBeingMarkedAsDeadLetter(Exception causeForBeingMarkedAsDeadLetter)
- Parameters:
causeForBeingMarkedAsDeadLetter- the reason for the message being marked as a Dead Letter Message
-
validate
public void validate()
-
-