You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to control exceptions thrown within event listeners?
We’re using events to communicate between modules, but we’re unsure how to properly manage the different types of exceptions that may be thrown by a module.
We’re currently dealing with two types of exceptions:
Retryable exceptions – should trigger a resubmission.
Non-retryable exceptions – should mark the event as failed.
We attempted to handle this by creating an aspect that marks the event as failed. However, the only way we found to prevent an exception from being retried was to simulate multiple attempts until the scheduler stops picking up the event—based on resubmission options with a high attempt count. This approach feels quite hacky and not clean.
Additionally, we noticed that unless the exception is rethrown, Modulith marks the event as completed—even if we explicitly marked it as failed. This behavior seems counterintuitive.
Is there anything on the roadmap regarding better exception management for events?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to control exceptions thrown within event listeners?
We’re using events to communicate between modules, but we’re unsure how to properly manage the different types of exceptions that may be thrown by a module.
We’re currently dealing with two types of exceptions:
We attempted to handle this by creating an aspect that marks the event as failed. However, the only way we found to prevent an exception from being retried was to simulate multiple attempts until the scheduler stops picking up the event—based on resubmission options with a high attempt count. This approach feels quite hacky and not clean.
Additionally, we noticed that unless the exception is rethrown, Modulith marks the event as completed—even if we explicitly marked it as failed. This behavior seems counterintuitive.
Is there anything on the roadmap regarding better exception management for events?
Beta Was this translation helpful? Give feedback.
All reactions