1.Endpoint

Mule的endpoint和WS中的endpoint是非常类似的,它是消息进出(读写)的入口,不同的是mule的endpoint可以基于各种不同的传输协议。
mule的endpoint分成两类:

  • global endpoint:全局的endpoint,一个flow或service的inbound或outbound endpoint可以通过ref属性引用这些endpoint.
  • low或service内的inbound或outbound endpoint,这类endpoint仅限于flow或service内,可以认为是一种局部endpoint.

每一个endpoint都必须指明它的传输协议是什么,或者说它是什么传输类型的endpoint,指定方式有两种:

  • 在<endpoint/>元素上追加传输协议前缀:
[html]view plaincopy
  1. <http:endpoint name="in" host="localhost" port="8080" path = "services/orders" user="${user.name}" password ="${user.password}"/>
  • 通过<endpoint/>元素的address属性指定:
[html]view plaincopy
  1. <endpoint addres="http://${user.name}:${user.password}@localhost:8080/services/orders/>

刚开始接触mule时对inbound和outbound的endpoint可能一时不太好区分,实际上所谓的in和out都是以mule的视角来定位的,inbound指的是外部message“流入”mule的断点,也就是mule暴露给外部应用可以访问的端点,同理,outbound就是message从mule向外“流出”的端点,也就是一个可以访问的外部应用的端点。比如一种最典型也是最普遍的WS代理配置,也就是将不同物理地址的WS统一挂接到ESB,由ESB以一致的地址发布,如:

[html]view plaincopy
  1. <pattern:web-service-proxy name="weather-forecast-ws-proxy"
  2. inboundAddress="http://localhost:8090/weather-forecast"
  3. outboundAddress="http://server1:6090/weather-forecast"
  4. wsdlLocation="http://server1:6090/weather-forecast?wsdl" />

在这段配置中,ESB把原物理地址为:http://server1:6090/weather-forecast 的服务经过包裹,以新的地址http://localhost:8090/weather-forecast 发布出去。作为inboundAddress,http://localhost:8090/weather-forecast是ESB对外“开放”或“发布”的端点,也就是消息流入ESB的端点。outboundAddress则是ESB路由的目的地,其往往是某个现存系统的访问入口。


2.Transformer

Transformer是负责消息传输过程中的数据转换,如从JSON对象到一个Java对象的转换:

[html]view plaincopy
  1. <json:json-to-object-transformer name="jsonToFruitCollection" returnClass="org.mule.module.json.transformers.FruitCollection">
  2. <json:deserialization-mixin mixinClass="org.mule.module.json.transformers.OrangeMixin" targetClass="org.mule.tck.testmodels.fruit.Orange"/>
  3. </json:json-to-object-transformer>

3.Filter

Filter是用于配置是否要对消息进行过滤的配置项,除像wildcard-filter这样的基本Filter,Mule还有功能强大的逻辑Filter用于进行过滤条件的组合。

[java]view plaincopy
  1. <or-filter>
  2. <wildcard-filter pattern="*priority:1*"/>
  3. <and-filter>
  4. <not-filter>
  5. <wildcard-filter pattern="*region:Canada*"/>
  6. </not-filter>
  7. <wildcard-filter pattern="*priority:2*"/>
  8. </and-filter>
  9. </or-filter>

4.Flow

Flow是mule的最基本处理单元。它从一个inbound endpoint开始,对message进行了一系列的处理,然后从outbound endpoint输出。这期间会flow会使用到上述提及的多种组件参与处理,如transformer、filter等等,而且还可能调用java或其他语言实现的组件进行处理,应该说在应用集成里,flow所要实现的,正是所谓的“集成逻辑”。

Mule的基本配置元素:Endpoint、Transformer、Filter、Flow相关推荐

  1. WCF调试异常信息:找不到类型“”,在 ServiceHost 指令中提供为 Service 特性值,或在配置元素 system.serviceModel/serviceHosting...

    "/CommonHelpServices"应用程序中的服务器错误. 找不到类型"JianKunKing.Common.CommonHelp.Services.Servic ...

  2. SpringSecurity权限管理框架系列(七)-SpringSecurity自定义配置类中自定义Filter的使用详解

    1.Filter请求过滤器 filter请求过滤器可以帮助我们进行HttpServletRequest请求和HttpServletResponse响应的过滤 在自定义的Filter过滤器中我们可以对我 ...

  3. SpringBoot下,利用@WebFilter配置使用与注意Filter

    Filter简介 Filter也称之为过滤器,它是Servlet技术中最实用的技术,WEB开发人员通过Filter技术,对web服务器管理的所有web资源:例如JSP,Servlet,静态图片文件或静 ...

  4. Asp.net Web.Config - 配置元素customErrors

    Asp.net配置文件的配置方式,其实在MSDN里面是写得最清楚的了.可惜之前一直未曾了解到MSDN的强大. 先贴个地址:http://msdn.microsoft.com/zh-cn/library ...

  5. SCCM 2012系列4 配置SCCM2012 Endpoint Protection上

    自微软的企业级防病毒FCS开始到FEP2010再到SCCM 2012集成防病毒,集成度是越来越高了,那今天我就给大家先分享下这个微软的企业防病毒吧! 1 部署Endpoint Protection客户 ...

  6. Asp.net Web.Config - 配置元素 httpCookies

    1.属性 属性 说明 domain 可选的 String 属性. 设置 Cookie 域名. httpOnlyCookies 可选的 Boolean 属性. 脚本(javascript之类)能够访问 ...

  7. springBoot配置多个过滤器filter的执行顺序

    1.自定义过滤器 过滤器类实现 javax.servlet.Filter.然后添加注解 @WebFilter(filterName="过滤器名称" urlPatterns=&quo ...

  8. 配置元素customErrors

    Asp.net配置文件的配置方式,其实在MSDN里面是写得最清楚的了.可惜之前一直未曾了解到MSDN的强大. 先贴个地址:http://msdn.microsoft.com/zh-cn/library ...

  9. 元素算法Bloom Filter

    最近研究元素算法,稍微总结一下,以后继续补充: 快速判断item是否存在于一个集合中.hbase使用bloomfilter算法,用blockID去regionMeta中判断是否分布在某个region中 ...

最新文章

  1. mysql单列索引和多列索引_mysql索引类型 normal, unique, full text
  2. Java 事件适配器 Adapter
  3. django-request对象
  4. 我是如何用Worktile进行敏捷开发的
  5. Logistic回归总结
  6. Redis 未授权访问缺陷可轻易导致系统被黑
  7. Django小项目简单BBS论坛
  8. C BackgroundWorker类详细说明
  9. Visual Studio 2013官方简体中文专业版/旗舰版/高级版下载(含激活序列号)
  10. Windows系统中设置定时开关机方法
  11. 【角度刁钻】如果把线程当作一个人来对待,秒懂
  12. win10系统如何设置局域网服务器,win10系统设置局域网地址的操作方法
  13. 185. 部门工资前三高的所有员工(重要)
  14. Python开发【第六章】:面向对象
  15. linux下wifi设备的实现逻辑
  16. 迪士尼2016年压轴巨作---《海洋奇缘》观后感
  17. 支付宝(蚂蚁)开放平台压力测试经验
  18. 嘴哥有料系列-can工具1:CAN诊断浅谈 + 如何用CAN工具进行诊断
  19. 求职简历-NLP工程师
  20. PCM音频文件的合成

热门文章

  1. VTK:vtkCaptionWidget用法实战
  2. OpenCASCADE:读取和写入 IGES
  3. OpenCASCADE:构建配置文件
  4. OpenCASCADE:下载安装
  5. wxWidgets:wxProcessEvent类用法
  6. boost::sort模块实现Spinsort算法的测试程序
  7. boost::process::pipe相关的测试程序
  8. boost::math模块计算贝塞尔函数的零点的测试程序
  9. boost::intrusive::splay_set用法的测试程序
  10. ITK:使用最小最大曲率流平滑RGB图像