Mulesoft 简明教程

MuleSoft - Introduction to Mule ESB

ESB 表示 Enterprise Service Bus ,它基本上是一个中间件工具,用于通过类似于总线的架构将各种应用程序集成在一起。从根本上说,它是一种设计,用于为集成应用程序之间的工作移动提供统一的手段。通过这种方式,在 ESB 架构的帮助下,我们可以通过通信总线连接不同的应用程序,并使它们能够在不相互依赖的情况下进行通信。

ESB stands for Enterprise Service Bus which is basically a middleware tool for integrating various applications together over a bus-like infrastructure. Fundamentally, it is an architecture designed to provide a uniform means of moving work among integrated applications. In this way, with the help of ESB architecture we can connect different applications through a communication bus and enable them to communicate without depending on one another.

Implementing ESB

ESB 架构的主要重点是将系统彼此解耦,并允许它们以稳定且可控的方式进行通信。ESB 的实现可以通过以下方式借助 ‘Bus’‘Adapter’ 来完成:

The main focus of ESB architecture is to decouple the systems from each other and allow them to communicate in a steady and controllable way. ESB’s implementation can be done with the help of ‘Bus’ and ‘Adapter’ in the following way −

  1. The concept of “bus”, which is achieved through a messaging server like JMS or AMQP, is used to decouple different applications from one another.

  2. The concept of “adapter”, responsible for communicating with backend application and transforming data from application format to bus format, is used between applications and bus.

通过总线从一个应用程序传递到另一个应用程序的数据或消息采用规范格式,这意味着将有一个一致的消息格式。

The data or message passing from one application to another through the bus is in a canonical format which means there would be one consistent message format.

适配器还可以执行其他活动,如安全、监视、错误处理和消息路由管理。

The adapter can also perform other activities like security, monitoring, error handling and message routing management.

ESB’s Guiding Principles

我们可以将这些原则称为核心集成原则。它们如下:

We can call these principles as core integration principles. They are as follows −

  1. Orchestration − Integration of two or more services to achieve synchronization between data and process.

  2. Transformation − Transforming data from canonical format to application specific format.

  3. Transportation − Handling protocol negotiation between formats like FTP, HTTP, JMS, etc.

  4. Mediation − Providing multiple interfaces to support multiple versions of a service.

  5. Non-functional consistency − Providing mechanism for managing transactions and security also.

Need of ESB

ESB 架构使我们能够集成不同的应用程序,其中每个应用程序都可以通过它来通信。以下是在何时使用 ESB 的一些指南 −

ESB architecture enables us to integrate different applications where each application can communicate through it. Following are some guidelines on when to use ESB −

  1. Integrating two or more applications − Use of ESB architecture is beneficial when there is a need to integrate two or more services or applications.

  2. Integration of more applications in future − Suppose if we want to add more services or applications in future, then it can be easily done with the help of ESB architecture.

  3. Using multiple protocols − In case if we need to use multiple protocols like HTTP, FTP, JMS etc., ESB is the right option.

  4. Message routing − We can use ESB in case if we require message routing based on message content and other similar parameters.

  5. Composition and consumption − ESB can be used if we need to publish services for composition and consumption.

P2P integration vs. ESB integration

随着应用程序数量的增加,摆在开发人员面前的一个大问题是,如何连接不同的应用程序?这种情况可以通过手动编写各种应用程序之间的连接来处理。这称为 point-to-point integration

With the increase in number of applications, a big question in front of developers was how to connect different applications? The situation was handled by hand-coding a connection between various application. This is called point-to-point integration.

p2p integration

Rigidity 是点对点集成的最明显的缺点。连接和接口的数量越多,复杂性也会越大。P-2-P 集成的缺点导致了我们使用 ESB 集成。

Rigidity is the most obvious drawback of point-to-point integration. The complexity increases with the increased number of connections and interfaces. The disadvantages of P-2-P integration leads us to ESB integration.

ESB 是用于实现应用程序集成的更灵活的方式。它将每个应用程序功能封装并公开为一组离散的可重用功能。没有任何应用程序直接与其他应用程序集成,取而代之的是通过 ESB 来集成,如下所示 −

ESB is a more flexible approach to application integration. It encapsulates and exposes each application functionality as a set of discrete reusable capabilities. No application directly integrates with other, instead they integrate through an ESB as shown below −

esb integration

为了管理集成,ESB 具有以下两个组件 −

For managing the integration, ESB has the following two components −

  1. Service Registry − Mule ESB has Service Registry/Repository where all the services exposed into the ESB are published and registered. It acts as a point of discovery from where one can consume the services and capabilities of other applications.

  2. Centralized Administration − As the name implies, it provides a view of transactional flows of performance of interactions occurring inside the ESB.

ESB Functionality − VETRO 缩写通常用于总结 ESB 的功能。具体如下 −

ESB Functionality − VETRO abbreviation is generally used to summarize the functionality of ESB. It is as follows −

  1. V(Validate) − As the name implies, it validates the schema validation. It requires a validating parser and up-to-date schema. One example is an XML document confirming to an up-to-date schema.

  2. E(Enrich) − It adds additional data to a message. The purpose is to make message more meaningful and useful to a target service.

  3. T(Transform) − It converts the data structure to a canonical format or from a canonical format. Examples are conversion of date/time, currency, etc.

  4. *R(*Routing) − It will route the message and act as a gatekeeper of the endpoint of a service.

  5. O(Operate) − The main job of this function is to invoke the target service or interacts with the target app. They run at the backend.

VETRO 模式为集成提供了整体灵活性,并确保只有经过验证一致的数据才能在整个 ESB 中路由。

VETRO pattern provides overall flexibility to the integration and ensures that only consistent and validated data will be routed throughout the ESB.

What is Mule ESB?

Mule ESB 是 MuleSoft 提供的轻量级且高度可扩展的基于 Java 的企业服务总线 (ESB) 和集成平台。Mule ESB 使开发人员能够轻松快速地连接应用程序。无论应用程序使用的技术如何,Mule ESB 都能轻松集成应用程序,使它们能够交换数据。Mule ESB 具有以下两个版本−

Mule ESB is a lightweight and highly scalable Java-based enterprise service bus (ESB) and integration platform provided by MuleSoft. Mule ESB allows the developer to connect applications easily and quickly. Regardless of various technologies used by applications, Mule ESB enables easy integration of applications, enabling them to exchange data. Mule ESB has the following two editions −

  1. Community Edition

  2. Enterprise Edition

Mule ESB 的优势在于,我们可以轻松地从 Mule ESB 社区版升级到 Mule ESB 企业版,因为这两个版本都是基于通用的代码库构建的。

An advantage of Mule ESB is that we can easily upgrade from Mule ESB community to Mule ESB enterprise because both the editions are built on a common code base.

Features & Capabilities of Mule ESB

Mule ESB 具有以下功能−

Following features are possessed by Mule ESB −

  1. It has simple drag-and-drop graphical design.

  2. Mule ESB is capable of visual data mapping and transformation.

  3. User can get the facility of 100s of pre-built certified connectors.

  4. Centralized monitoring and administration.

  5. It provides robust enterprise security enforcement capabilities.

  6. It provides the facility of API management.

  7. There is secure Data Gateway for cloud/on-premise connectivity.

  8. It provides the service registry where all the services exposed into the ESB are published and registered.

  9. Users can have control through a web-based management console.

  10. Rapid debugging can be performed using service flow analyzer.