简体   繁体   English

WSO2 ESB中介顺序与代理服务

[英]WSO2 ESB Mediation Sequence vs Proxy Service

WSO2 ESB has Mediation Sequences and Proxy Services for implementing EAI patterns. WSO2 ESB具有用于实现EAI模式的中介序列和代理服务。 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? 我什么时候应该使用?

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. 因此,中介序列是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. 假设中介者可以成功处理这些消息,那么从理论上讲,中介序列可以用于处理通过它的任何类型的消息(二进制,JSON,XML)。

Therefore a mediation sequence can be used to, 因此,调解序列可用于

  1. Proxy the messages to/from a web service 代理到/来自Web服务的消息
  2. Proxy the messages to/from a REST service 代理往返REST服务的消息
  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中的特殊模块,旨在满足1.的要求。(代理到/来自Web服务的消息)因此,代理服务是受Web Service端点支持的专用中介序列。

WSO2 ESB facilitates to create Proxy Services in different ways for the different types of requirements. WSO2 ESB有助于以不同的方式针对不同类型的需求创建代理服务。

eg: 例如:

  1. WSDL based proxy - Used to create a proxy service using a given WSDL 基于WSDL的代理-用于使用给定的WSDL创建代理服务
  2. Pass through proxy - Used to simply create a proxy service using the Endpoint URL 直通代理-用于仅使用端点URL创建代理服务

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. 在高级代理中,代理显然也是向服务使用者提供的服务,但是它实际上调用了实际的端点来完成实际的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM