

Messenger specific concept, it gives full flexibility inside the message bus,īy wrapping the messages into it, allowing to add useful information inside Middleware are calledīoth when a message is originally dispatched and again later when a message Replacing it, as well as interrupt the middleware chain. Which means they can tweak the envelope, by adding stamps to it or even They are also responsible for calling the next middleware in the chain, Instead, they are cross cutting concernsĪpplicable throughout the application and affecting the entire message bus.įor instance: logging, validating a message, starting a transaction. Literally "the software in the middle", those are not about core concerns Middleware can access the message and its wrapper (the envelope) while it is Handlers are called by the HandleMessageMiddleware middleware.

Responsible for handling messages using the business logic applicable to the messages. This can be a message queue puller or an API endpoint for example. Responsible for retrieving, deserializing and forwarding messages to handler(s). Something can be a message broker or a third party API for example. Responsible for serializing and sending messages to something.
