Class DecodeErrorStrategy.DeadLetter
-
- All Implemented Interfaces:
-
eu.vstoyanov.natsy.codec.DecodeErrorStrategy
public final class DecodeErrorStrategy.DeadLetter implements DecodeErrorStrategy
Republish the raw undecodable message to subject, then drop it from this subscription.
The dead-lettered message carries the original payload and headers plus the provenance headers in DeadLetterHeaders.
subject must be captured by a stream. On JetStream the dead letter is published as a JetStream message, and the original is terminated only once the server has acknowledged storing it - so a dead letter that never lands cannot take the original down with it. The flip side is that a dead-letter subject with no stream behind it holds every undecodable message unacknowledged for redelivery, which
subscribeandpullreject up front rather than let you discover one message at a time.On core NATS there is no stream and no acknowledgement to wait for: the dead letter is a core publish, and reaches only whatever is listening on subject at that moment.
-
-
Constructor Summary
Constructors Constructor Description DecodeErrorStrategy.DeadLetter(String subject)
-
Method Summary
Modifier and Type Method Description final StringgetSubject()-
-
Constructor Detail
-
DecodeErrorStrategy.DeadLetter
DecodeErrorStrategy.DeadLetter(String subject)
-
-
Method Detail
-
getSubject
final String getSubject()
-
-
-
-