Class ShouldEnqueue<M extends Message>
java.lang.Object
org.axonframework.messaging.deadletter.ShouldEnqueue<M>
- Type Parameters:
M- An implementation ofMessagecontained in thedead letterthat's been made a decision on.
- All Implemented Interfaces:
EnqueueDecision<M>
An
EnqueueDecision stating a dead letter should be enqueued.- Since:
- 4.6.0
- Author:
- Steven van Beelen
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a defaultEnqueueDecision.ShouldEnqueue(Throwable enqueueCause) ShouldEnqueue(Throwable enqueueCause, Function<DeadLetter<? extends M>, Metadata> diagnosticsBuilder) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanThe decision whether thedead lettershould be enqueued in a queue.toString()DeadLetter<? extends M> withDiagnostics(DeadLetter<? extends M> letter)
-
Constructor Details
-
ShouldEnqueue
public ShouldEnqueue()Constructs a defaultEnqueueDecision. This decision does not carry anyenqueueCause()ordiagnostics. -
ShouldEnqueue
- Parameters:
enqueueCause- TheThrowablethat was used to decide to enqueue.
-
ShouldEnqueue
public ShouldEnqueue(Throwable enqueueCause, Function<DeadLetter<? extends M>, Metadata> diagnosticsBuilder) - Parameters:
enqueueCause- TheThrowablethat was used to decide to enqueue.diagnosticsBuilder- A function constructing diagnostics to append duringwithDiagnostics(DeadLetter).
-
-
Method Details
-
shouldEnqueue
public boolean shouldEnqueue()Description copied from interface:EnqueueDecisionThe decision whether thedead lettershould be enqueued in a queue. Whenfalsethe dead letter should be evicted.- Specified by:
shouldEnqueuein interfaceEnqueueDecision<M extends Message>- Returns:
trueif thedead lettershould be enqueued,falseif the dead letter should be evicted.
-
enqueueCause
Description copied from interface:EnqueueDecisionAThrowableOptionalthat was part of deciding to enqueue thedead letterin a queue. Empty if thedead lettershould be evicted or when there is no failure cause used for deciding to enqueue.- Specified by:
enqueueCausein interfaceEnqueueDecision<M extends Message>- Returns:
- The deciding failure for enqueueing a
dead letter, when present.
-
withDiagnostics
Description copied from interface:EnqueueDecisionAddsDeadLetter.diagnostics()Metadatato the givenletter. The added diagnostics may provide additional information on the decision that may be used to influence future decisions.By default, the
letteris returned as is.- Specified by:
withDiagnosticsin interfaceEnqueueDecision<M extends Message>- Parameters:
letter- Thedead letterto adddiagnosticMetadatato.- Returns:
- A copy of the given
letterwhendiagnosticMetadatawas added.
-
equals
-
hashCode
public int hashCode() -
toString
-