eventuate-tram/eventuate-tram-core

Implement CommandNameMapping

vincenzocorso opened this issue · 1 comments

I'm using Eventuate Tram Sagas Framework to write an example saga. I have a question.
When the orchestrator send a command to saga partecipants, the message has this header: "command_type": "it.vincenzocorso.carsharing.rentsagasorchestratorservice.domain.commands.CreateRentCommand". There is a way to override this header? I would it was something like "command_type": "CREATE_RENT_COMMAND".

cer commented

This is a great request.
Currently, there is not a way to accomplish this.

The solution is to implement the equivalent of DomainEventNameMapping for commands. DomainEventPublisherImpl uses DomainEventNameMapping to translate the class name to an "external name".
DomainEventDispatcher does the inverse

The CommandProducer and CommandDispatcher classes would use a CommandNameMapping class to do something equivalent.