WSO2 ESB Mediation Sequence vs Proxy Service

大兔子大兔子 提交于 2020-01-04 13:48:27

问题


WSO2 ESB has Mediation Sequences and Proxy Services for implementing EAI patterns. I am currently new and couldn't distinguish when to use a Mediation Sequence or Proxy Service. Both seem to work well in most of the use cases. When should I use each?


回答1:


Sequence (Mediation Sequence) is a sequence of Mediators. A message comes into the sequence, passes through the each mediator, in the order they are located in the sequence. So a Mediation Sequence is the generic building material of WSO2 ESB.

A Mediation Sequence can be theoretically used to process any type of message (binary, JSON, XML) passes through it given that mediators can successfully process these messages.

Therefore a mediation sequence can be used to,

  1. Proxy the messages to/from a web service
  2. Proxy the messages to/from a REST service
  3. And many more applications.....

A Proxy Service is the special module in WSO2 ESB that is designed to fulfill the requirements of the 1. (Proxy the messages to/from a web service) Therefore a Proxy service is a specialized Mediation Sequence with the support of Web Service Endpoints.

WSO2 ESB facilitates to create Proxy Services in different ways for the different types of requirements.

e.g.:

  1. WSDL based proxy - Used to create a proxy service using a given WSDL
  2. Pass through proxy - Used to simply create a proxy service using the Endpoint URL



回答2:


If you need to proxy a service and if you need to mediate and perform different operations to the message you can use proxy services.

Sequence is a set of mediator (tree of mediators) though which you can send messages. If you consider mediator as building units, you can add them in a order and define it as a sequence which is reusable later. You can refer the sequence inside the proxy service and let the message flow through mediators defined in the sequence.

At high level proxy is also apparently a service to a service consumer but it actually call the actual endpoint to get the actual work done.



来源:https://stackoverflow.com/questions/14516623/wso2-esb-mediation-sequence-vs-proxy-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!