Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: 'Global' failure handlers for failed participants #87

Open
cer opened this issue Sep 20, 2022 · 0 comments
Open

Proposal: 'Global' failure handlers for failed participants #87

cer opened this issue Sep 20, 2022 · 0 comments

Comments

@cer
Copy link
Collaborator

cer commented Sep 20, 2022

Currently:

  • If a SagaParticipant sends back a failure message, step() onReply() must be used to update the SagaData with the error
  • This can be repetitive if the application has a standardized way to handle errors

Proposed:

Define Spring @beans that implement the following interface:

interface SagaParticipantFailureHandler<T SagaData> extends Ordered   {
     void handleFailure(T, SagaData sagaData);
}

If a saga participant throws an exception, the first (sorted by Ordered) applicable - to exception and saga data - is invoked to update the SagaData prior to starting compensation.

Analogous to #86

@cer cer changed the title Proposal: 'Global' exception handlers for failed participants Proposal: 'Global' failure handlers for failed participants Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant