I want to check some constraints on messages and "canonicalize" them accordingly on the way to the final consumer.
I need to listen to any event of any type , load the rules (based on the type of the message) from IoC apply changes to the messages and let all of them pass.
Am I in a true rode? Am I allowed to change the messages in the middleware or I should do the following steps?
- Listen to the events
- Create commands
- Send them
- Handle the commands(apply the rules by the consumer)
- Create new events from the changed messages
- And finally publish new events from them