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

Retry execution of command handler instead of triggering compensation #80

Open
ghost opened this issue Jul 11, 2022 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Jul 11, 2022

Hi,

how can we retry the execution of a command handler method in case of failure instead of triggering the compensation logic immediately?

public CommandHandlers commandHandlerDefinitions() {
  return SagaCommandHandlersBuilder.fromChannel("CHANNEL_NAME")
      .onMessage(Command.class, this::handleCommand)
      .build();
}

public Message handleCommand(final CommandMessage<Command> command) {
  try {
    
    //logic
    return withSuccess();
} catch (Exception e) {

   // in case of failure, I want to retry the method instead of directly triggering the compensations action
   return withFailure(SagaError.of(e));
}
@StefanMessner
Copy link

StefanMessner commented Dec 20, 2022

Is there any update on this issue? Would be a realy valuable feature.

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