Dbal Dead Letter
Last updated
Was this helpful?
Last updated
Was this helpful?
Ecotone comes with full support for managing full life cycle of a error message by using Dbal Module.
Store failed Message with all details about the exception
Allow for reviewing error Messages
Allow for deleting and replaying error Message back to the Asynchronous Message Channels
To make use of Dead Letter, we need to have Ecotone's Dbal Module installed.
If we configure default error channel to point to "dbal_dead_letter" then all Error Messages will land there directly
config/packages/ecotone.yaml
ecotone:
defaultErrorChannel: "dbal_dead_letter"
We may also want to try to recover before we consider Message to be stored in Dead Letter:
config/packages/ecotone.yaml
ecotone:
defaultErrorChannel: "errorChannel"
and then we use inbuilt Retry Strategy:
#[ServiceContext]
public function errorConfiguration()
{
return ErrorHandlerConfiguration::createWithDeadLetterChannel(
"errorChannel",
// retry strategy
RetryTemplateBuilder::exponentialBackoff(1000, 10)
->maxRetryAttempts(3),
// if retry strategy will not recover, then send here
"dbal_dead_letter"
);
}
Get more details about existing commands
bin/console ecotone:deadletter:help
Listing current error messages
bin/console ecotone:deadletter:list
Get more details about given error message
bin/console ecotone:deadletter:show {messageId}
Replay error message. It will return to previous channel for consumer to pick it up and handle again.
bin/console ecotone:deadletter:replay {messageId}
Replaying all the error messages.
bin/console ecotone:deadletter:replayAll
Delete given error message
bin/console ecotone:deadletter:delete {messageId}
#[ServiceContext]
public function dbalConfiguration()
{
return DbalConfiguration::createWithDefaults()
->withDeadLetter(false);
}
The above solution requires running Console Line Commands. If we want however, we can manage all our Error Messages from one place using Ecotone Pulse.
This is especially useful when we've multiple Applications, so we can go to single place and see if any Application have failed to process Message.