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

Implement nested commands #179

Open
cer opened this issue Aug 12, 2022 · 3 comments
Open

Implement nested commands #179

cer opened this issue Aug 12, 2022 · 3 comments

Comments

@cer
Copy link
Contributor

cer commented Aug 12, 2022

Currently

  • a command handler returns a reply message.
  • The command handler cannot be implemented using a command

Proposed:

Support command handlers that

  • Return void
  • Have a parameter - CommandReplyToken - that contains the data needed to construct a reply, e.g. message headers etc.
  • CommandReplyToken can be serialized/stored in a database and used to later to reply
@cer
Copy link
Contributor Author

cer commented Aug 15, 2022

  • More overloaded CommandHandlersBuilder methods
  • Nested reactive command handlers

cer added a commit that referenced this issue Aug 15, 2022
@cer
Copy link
Contributor Author

cer commented Aug 15, 2022

Example command handler:

Example command handler:

   public void handleComplexCommand(CommandMessage<TestComplexCommand> cm, CommandReplyToken replyToken) {
               // save replyToken for later
    }

Example of sending a reply later

Use the CommandReplyProducer @Bean

@Autowired
private CommandReplyProducer commandReplyProducer;

....
CommandReplyToken replyToken = .... ; // from earlier
List<Message> replies = commandReplyProducer.sendReplies(replyToken, Collections.singletonList(withSuccess()));

cer added a commit that referenced this issue Aug 15, 2022
@cer
Copy link
Contributor Author

cer commented Aug 15, 2022

eventuate-tram/eventuate-tram-sagas@0bfe1df reflects changes made by 66d8bb7

cer added a commit that referenced this issue Aug 16, 2022
…ReplyToken to enable deserialization, Renamed CommandHandlerArgs.getReplyInfo() to getCommandReplyToken()
cer added a commit to eventuate-tram/eventuate-tram-core-quarkus that referenced this issue Oct 3, 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