abp
abp copied to clipboard
Handle the exception in `InboxProcessor` and `OutboxSender`.
Resolve #11210
It is not acceptable to skip an event and continue to publish/consume the next one. Event publish/consume order can be important in some cases. A true solution can be providing a failure policy, by designing a system that the final developer decided what to do on that case (a few times retry, re-queue event with a delay, ignore / drop message, etc. which can depend on the event data).
So, currently,
- if developers want to ignore errors on event handler, they can easily use try-catch, log and ignore the error.
- if they want to requeue, they can catch the error and republish the message with a custom data attached to count the error count for example
- outbox failures should be related to eventbus (e.g. rabbitmq) connections, and waiting and retrying should be enough, instead of ignoring errors and going to the next event.
If you want to think on that and find a complete solution, you're welcome. Otherwise, please keep the issue #11210 open, so we think on it later.