Mediator pipeline process before handle the actual operation mediator allowing to pre-processor
- Mediator Pattern is useful in complex or enterprise level applications, where request processing involve more than just logic.
- Handling a request requires some additional steps: logging, validation, auditing, security checks etc (know as cross cutting concerns)
- MediaR provides a mediator pipeline where these cross cutting concerns are to be inserted transparently.
- Pipline coordinated the request handling, ensuring that all necessary steps are executed in right order.
- In MediaR, pipeline behavior are used to implement these cross cutting concerns .
- They wrap around the request handling allowing you to execute the logic before and after actual handler is called.
Implement 2 Behavior in our Catalog Micro services
- Log Behavior- that log details about handling, of the request.
- Validation Behavior - validate incoming requests before they reach the handler.