12

Anybody would please through some light on difference between call and send mediator and what use cases these two mediators are used.

Community
  • 1
  • 1
storia321
  • 381
  • 2
  • 22

3 Answers3

17

Send mediator - used to send messages out of Synapse to some endpoint. Then the response is returned to the OutSequence where you can send it back to the client

Use cases - When you only need to send a message to one back end and return the response back to the client.

Call mediator - Also used to send messages out of the Synapse to some endpoint, but the response does not come to the OutSequence. When we send a request using the call mediator, the response will arrive to the mediator that is placed right after the call mediator.So this will allow us to specify all the service invocations one after the other in a chain within a single sequence

Use cases - Service chaining. i.e.- Vehicle license renewal service

Riyafa Abdul Hameed
  • 7,417
  • 6
  • 40
  • 55
krishan
  • 579
  • 3
  • 9
0

Another characteristic is that the callout mediator is blocking, send mediator and call mediator are not blocking. This answer is in regards to WSO2 versions until 4.8.0

Lucas Pires
  • 1,281
  • 14
  • 21
  • 1
    Maybe this was the case in 2015 when you answered the question, it certainly isn't now. The call mediator is non blocking by default in current versions. – andynormancx Feb 23 '17 at 16:22
  • Dear Down-Voter: Please leave a criticism along with your vote. Until versions 4.9 this answer is true – Lucas Pires Mar 09 '17 at 14:06
  • I did leave a comment when I down voted. What do you mean "Until versions 4.9 this answer is true" ? In 4.9.0 it is non-blocking by default https://docs.wso2.com/display/ESB490/Call+Mediator and was also non-blocking in 4.8.0 https://docs.wso2.com/display/ESB480/Call+Mediator – andynormancx Mar 10 '17 at 11:31
0

• Call mediator: This mediator can be used in both blocking and non-blocking modes. In blocking mode, the mediation is executed in a single thread and waits for the response before proceeding. In non-blocking mode, the mediation is executed in multiple threads and registers a callback for the response. The call mediator can be used to implement service chaining, where the response from one service is used to invoke another service within the same sequence.

• Send mediator: This mediator is always non-blocking and uses the passthrough transport for better performance. The send mediator does not wait for the response but sends it to the out sequence or fault sequence depending on the outcome. The send mediator can be used when you only need to send a message to one service and return the response back to the client.