- Mediator can echo source messages back to the initial caller without routing the message to another target.
- Echo option is used when we don’t have target service available ,we expose Mediator functionality as target service and Echo a response to initial caller . Suppose we are doing query from target service but that target service is down due to some reason , in this case to test our Mediator we use Echo, we will create sample query response message and pass that to calling service as a Echo.
- This is typically used in use cases where a certain message has to be enriched, or some filtering to be done, etc.
Implementation:
Create one project and add Mediator to it. Name it as “MediatorEcho” and made it as Synchronous.
Note: we can also use custom xsd for the echo mediator.
Go to Mediator mplan file and open one static routing rule.
Choose “Echo Reply” from available options.
Do the required mapping and map all the fields which we want to send to initial caller as Echo.
Deploy and test.
No comments:
Post a Comment