- 1. MULE框架介绍李少辉
2011年4月12日
- 2. 目 录ESB && MULE介绍MULE主要构件通道(Transport)路由器(Router)变形金刚(Transformer)服务组件(Service Component)异常与日志处理(Exception && Logging)安全与事务(Security && Transaction)实例讲解
- 3. ESB介绍系统A系统B系统C系统D现有很多系统架构:系统交互性太多,系统依赖太多,当一个系统down掉,所有系统都可能受到影响
- 4. ESB介绍系统A系统B系统D系统EESB系统结构结构:系统之间交互性少,相互之间依赖少,当一个系统down掉,影响少BUS(总线)系统C系统F
- 5. ESB介绍现有的ESB产品:
- 6. ESB介绍服务接入消息转化消息路由消息过滤ESB框架最基础的支持:
- 7. MULE介绍—入门1、官方网站 && 下载地址
2、安装以及配置
3、目录介绍
4、运 行
5、MULE IDE
- 8. MULE介绍—入门一、官方地址
http://www.mulesoft.org
二、设置环境变量( MULE_HOME 和 PATH)
set MULE_HOME=C:\Mule
set PATH=%PATH%;%MULE_HOME%\bin
三、目录介绍:
/bin Shell and batch scripts for controlling Mule from the command line
/conf Configuration files
/docs API documentation (Javadoc) for Mule and its sub-projects
/examples Example applications you can run and try building yourself
/lib/boot Libraries used by the Java Service Wrapper to boot the server
/lib/endorsed Endorsed Java libraries used by Mule
/lib/mule Mule libraries
/lib/opt Third-party libraries
/lib/user Your custom classes and libraries. This directory comes before
/lib/mule on the classpath and can be used to patch the distributed
Mule classes. You must restart Mule after adding files to this directory.
/licenses License information for all libraries shipped with Mule
/logs Log file output when running in background mode
/sbin Internal scripts (not to be run by the user)
/src The source code for all Mule modules
- 9. MULE介绍—入门四、运行Mule
mule [-config your-config.xml]
mule start|stop|restart [-config ]
五、Mule IDE
- 10. MULE主要构件--MODELServiceServiceException ListenerLifecycle AdapterEntry Point ResolversServiceModel
- 11. MULE主要构件--ServiceTransportInbound
RouterComponentOutbound
RouterTransportException ListenerService
- 12. MULE主要构件--TransportTransport
(抽象概念)ConnectorEndPointTransformer
- 13. MULE主要构件
- 14. 通道(Transport)文件控制台
(STDIO)邮 件
(IMAP && SMTP)WEBSERVICE(CXF && AXIS)HTTPJMSFTPJDBCEJBXMPPVM
- 15. 连接器(Connector)
- 16. STDIO通道(STDIO Transport)标准输入输出通道:主要用于测试目的:
Inbound:用于在控制台接受用户的输入信息
Outbound:用于在控制台输出业务信息
- 17. CXF通道(CXF Transport)输入股票代码,调用外部CXF服务,得到结果写入标准输出,调GetQuote暴露一个CXF web服务,提供给外部系统调用
- 18. 文件通道(File Transport)读取/data/snapshot/下的文件,然后写入到/data/archive/目录下,文件名按一定格式修改
- 19. Http通道(Http Transport)通过http监听,接受外部提交的数据,然后写入磁盘读/data/provider/目录下文件,将文件提交到外部http地址
- 20. Email通道(Email Transport)从远程服务器上读取邮件,经处理,将邮件信息插入到数据库从/data/invoice/目录下读取文件转化为字符串,通过邮件发送出去
- 21. Ftp通道(Ftp Transport)连接到远程Ftp服务器(设置用户名、密码、目录,扫描频率),将新文件写
入到/out/下读取/in/目录下的新文件,写入到远程ftp服务器
- 22. JMS通道(JMS Transport)The JMS Transport can be used to send and receive JMS messages on queues and topics; using either the
1.0.2b or 1.1 versions of the JMS spec. Mule does not implement a JMS server, so you will use the JMS
transport in conjunction with a JMS implementation like ActiveMQ or Tibco EMS. Because of this, you'll
have to put the client jars for your JMS provider in the lib/user directory in your Mule installation.
- 23. JMS通道(JMS Transport)从http通道接受一个数据,将数据转化之后写入到topic:backup-reports向JMS服务器发送消息:
- 24. JMS通道(JMS Transport)从topic:backup-reports服务器读取消息,并将消息转化为对象,
最后将对象输出到控制台从JMS服务器读取消息:
- 25. JDBC通道(JDBC Transport)JDBC 基本属性:数据源定义(支持spring) :or
- 26. JDBC通道(JDBC Transport)使用Inbound 执行查询获取数据:Jdbc连接器定义:
- 27. JDBC通道(JDBC Transport)使用Outbound 执行数据插入:Jdbc连接器定义:
- 28. EJB通道(EJB Transport)基本属性:调用EJB服务getGreeting方法:
- 29. VM通道(VM Transport)The VM transport is a special kind of transport that you'll use to send messages via memory
- 30. 路由器(Router)Inbound
EndPointInbound
RouterComponentComponentOutbound
RouterOutbound
EndPoint过滤器(Filter)类 型内 容表达式逻 辑
- 31. 策略(Strategy)InBound EndPointComponentStrategyDropped消息进入之后,多种去向:
- 32. (过滤器)Filter一、基于类型:二、基于文本内容三、基于表达式
- 33. (过滤器)Filter四、基于逻辑表达式