Mule ESB介绍
- 格式:pptx
- 大小:2.00 MB
- 文档页数:21
Mule ESBMule ESB简介什么是Mule ESB?Mule ESB是一种基于java的、轻量级的企业服务总线和集成平台,她允许开发者快速的、简单的连接应用,并能够实现数据的转换。
从2005年发表1.0版本以来,Mule吸引了越来越多的关注者,成为开源ESB中的一支独秀。
目前许多公司都使用了Mule,比如沃尔玛,惠普,索尼,Deutsche Bank 以及CitiBank 等公司。
Mule官方网站:/Mule ESB的主要功能如下:●服务的创建与管理(Service creation and hosting):用Mule ESB作为一个轻量级的服务容器来暴露和管理可重用的服务。
●服务调解(Service mediation):隐藏服务消息的格式和协议,将业务逻辑从消息中独立出来,并可以实现本地独立的服务调用。
●消息路由(Message routing):基于内容和规则的消息路由、消息过滤、消息合并和消息的重新排序。
●数据转换(Data transformation):在不同的格式和传输协议中进行转换数据。
Mule3Mule近期推出了Mule3,Mule3的新增特点-云连接(Cloud Connect)。
云连接提供了可以用简单安全的方式为企业提供基于云技术的数据和服务。
它的核心是IBeans,一个轻量级、可重用的接口,用于Web技术的连接扩展和数据服务。
Mule云包括以下内容1、Integration Beans (合成bean):他们是可重用的云接口,可以注入到组件中,可以接受外部的服务,比如说亚马逊、推特、Facebook等,并且是一种简单的接收服务、管理安全机制的方法。
请求验证、数据传输、错误挂起等也可以通过这种方法来实现。
2、Rest / JAX-RS:(REST协议:即REST(Representational State Transfer表述性状态转移)是一种针对网络应用的设计和开发方式,可以降低开发的复杂性,提高系统的可伸缩性。
MULE_ESB部署手册美国赛特斯网络科技(南京)有限责任公司1说明本文档适合的阅读对象为刚接触ESB项目研发人员需要了解ESB产品部署的测试人员。
通过阅读本文档,测试及FAE人员能够初步掌握ESB的部署方法。
2Linux安装配置MULE_ESB环境2.1JDK安装配置(可视具体情况而定)推荐使用的JDK版本为JDK1.6.0_24。
将jdk-6u24-linux-i586.bin放到/usr/java下修改jdk-6u24-linux-i586.bin文件权限,具有可执行权限Chmod 777 jdk-6u24-linux-i586.bin执行该文件:./ jdk-6u24-linux-i586.bin添加环境变量:进入profile文件vi /etc/profile在profile中最后添加如下内容:export JAVA_HOME=/usr/java/jdk1.6.0_24export PATH=$JAVA_HOME/bin:$PATH执行source命令[root@localhost plugins]# source /etc/profile查看系统中java启动是否正确,注意这个和环境变量:[root@localhost java]# java -versionjava version "1.6.0_24"Java(TM) SE Runtime Environment (build 1.6.0_24-b07)Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)如果出现上面的内容,则表示SUN JDK安装成功2.2MULE安装配置(可视具体情况而定)2.2.1拷贝部署文件源程序1、Mule部署需要的压缩tar包文件mule-standalone-3.3-M2.tar存放在172.16.33.166 上的/home/cm/iMON/IMON.2012.6.22_dev/esb 目录下的。
Mule ESB Studio v3.3 安装使用手册1***初级教程***如果你还没有做好准备,请到下载免费的社区版Mule ESB,按照网站上的说明启动Mule Studio,并且选择一个工作区(另外,你还可以下载30天免费试用的企业版Mule ESB)2安装Mule Studio安装前,请确认你的机器上已经安装了1.6版本的JDK。
最后请确认你的JDK环境变量配置是否正确2.1 导出将下载的文件解压到你的硬盘分区的根目录下,例如:C:\1. 执行找到C:\MuleStudio目录,运行muleStudio.exe启动Studio2. 选择工作区点击OK使用默认的工作区3使用Studio模板1. 点击File菜单,选择New > Mule Project2. 出现New Mule Project面板后,为你的项目输入名称和一个简短的说明,如图:3. 在Server Runtime选项上选择你将要使用的Mule运行时版本,如图:4. 点击旁边的复选框,根据现有的模板创建项目,单击项目,选择你想要使用的模板创建项目,如图:5. 点击Finish按钮,Mule Studio会创建并打开一个新的项目,完成预创建和预配置的流程6. 在Mule Studio的Package Explorer栏中,右键点击mule-config.mflow文件,选择RunAs > Mule Application7. 停止运行该项目,请在Mule Studio控制台点击红色的Terminate按钮,如图:4运行独立的例子1. 到Mule ESB Standalone目录下,找到Examples目录下你想运行的例子2. 拷贝.zip文件的例子到$MULE_HOME/apps目录下,例如:运行Flight Reservationexample的例子,拷贝mule-example-flight-reservation-3.3.0.zip到$MULE_HOME/apps 目录下,如图:3. 启动Mule,运行这个例子5启动Mule Studio如果你在安装过程中启动了Mule Studio,并且已经在运行了,请跳过本节的其余部分,直接进行:创建新项目如果当前Mule Studio没有启动,通过完成下面的步骤启动应用程序1. 找到Mule Studio安装目录2. 执行muleStudio.exe3. 点击OK使用默认的工作区6创建新项目1. 如果你看到是各种控制组件的应用程序窗口(右下图),请直接进入第2节。
Mule安全证书的管理概念安全性围绕的主题有验证、授权、消息完整性等。
实现异常处理机制是实现安全机制的前提条件,因为你将遇到诸如验证或授权失败等异常。
MULE和SERVICEMIX中的输入消息验证和授权安全技术,比如轻量级目录访问协议(LDAP)和JAVA验证和授权服务(JAAS)。
Mule ESB安全管理(Mule Sercurity Manager)—端点利用传输的特定细节或普通的认证方法对请求信息进行验证。
—在Mule ESB管理者处定义安全管理者。
—配置安全过滤器。
有四种策略配置:∙JAAS Security∙PGP Security∙Acegi Security∙Component Authorization Using Acegimule安全管理配置1.在mule中的配置<mule-configuration><security-manager><security-provider name="memory-dao"className="org.mule.extras.acegi.AcegiProviderAdapter"><properties><container-property name="delegate"reference="daoAuthenticationProvider"/></properties></security-provider></security-manager>....</mule-configuration>2.mule配置<container-contextclassName="org.mule.extras.spring.SpringContainerContext"> <properties><property name="configFile" value="securityContext.xml"/> </properties></container-context><beans><bean id="daoAuthenticationProvider"class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"><property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property></bean><bean id="inMemoryDaoImpl"class="erdetails.memory.InMemoryDaoImpl"> <property name="userMap"><value>ross=ross,ROLE_ADMINanon=anon,ROLE_ANONYMOUS</value></property></bean></beans>3.加密策略<security-manager><encryption-strategy name="PBE"className="org.mule.impl.security.PasswordBasedEncryptionStrategy "><properties><property name="password" value="mule"/></properties></encryption-strategy></security-manager>上面的加密策略可以被引用<transformers><transformer name="EncryptedToByteArray"className="org.mule.transformers.encryption.DecryptionTransformer "><properties><property name="strategyName" value="PBE"/></properties></transformer></transformers>4.端口策略文件<endpoint address="http://localhost:4567"><security-filterclassName="org.mule.extras.acegi.filters.http.HttpBasicAuthentica tionFilter"><properties><property name="realm" value="mule-realm"/></properties></security-filter></endpoint><endpoint address="http://localhost:4567"><security-filter useProviders="default,another"className="org.mule.extras.acegi.filters.http.HttpBasicAuthentica tionFilter"/></endpoint>5.Spring安全策略配置<?xml version="1.0" encoding="UTF-8"?><mule xmlns="/schema/mule/core/2.2"xmlns:xsi="/2001/XMLSchema-instance"xmlns:spring="/schema/beans"xmlns:http="/schema/mule/http/2.2"xmlns:mule-ss="/schema/mule/spring-secur ity/2.2"xmlns:ss="/schema/security"xsi:schemaLocation="/schema/beans/schema/beans/spring-beans-2.5.xsd /schema/mule/core/2.2/schema/mule/core/2.2/mule.xsd/schema/mule/http/2.2/schema/mule/http/2.2/mule-http.xsd/schema/mule/spring-security/2.2 /schema/mule/spring-security/2.2/mule-sp ring-security.xsd/schema/security/schema/security/spring-security-2.0.xsd"><mule-ss:security-manager><mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager" /></mule-ss:security-manager><spring:beans><ss:authentication-manager alias="authenticationManager" /><ss:authentication-provider><ss:user-service id="userService"><ss:user name="ross" password="ross"authorities="ROLE_ADMIN" /><ss:user name="anon" password="anon"authorities="ROLE_ANON" /></ss:user-service></ss:authentication-provider></spring:beans>...cut...</mule><?xml version="1.0" encoding="UTF-8"?><mule xmlns="/schema/mule/core"xmlns:xsi="/2001/XMLSchema-instance"xmlns:spring="/schema/beans"xmlns:mule-ss="/schema/mule/spring-security"xmlns:ss="/schema/security"xmlns:http="/schema/mule/http"xsi:schemaLocation="/schema/beans/schema/beans/spring-beans-2.5.xsd/schema/mule/core/schema/mule/core/3.0/mule.xsd/schema/mule/spring-security/3.0/schema/mule/spring-security/3.0/mule-spring-security.xsd /schema/security/schema/security/spring-security-2.0.xsd/schema/mule/http/schema/mule/http/3.0/mule-http.xsd"><spring:beans><ss:authentication-manager alias="authenticationManager"/><ss:authentication-provider><ss:user-service id="userService"><ss:user name="john" password="password" authorities="ROLE_ADMIN"/> </ss:user-service></ss:authentication-provider></spring:beans><mule-ss:security-manager><mule-ss:delegate-security-provider name="memory-dao"delegate-ref="authenticationManager"/></mule-ss:security-manager><model name="springSecurityHttpModel"><service name="springSecurityHttpService"><inbound><http:inbound-endpoint address="http://localhost:8081/secure"exchange-pattern="request-response"><mule-ss:http-security-filter realm="mule"/></http:inbound-endpoint></inbound><echo-component/></service></model></mule><mule-ss:security-manager><mule-ss:delegate-security-providername="ldap-security-provider"delegate-ref="authenticationManager"/></mule-ss:security-manager><security-manager><password-encryption-strategyname="passwordEncryption"password="password"/></security-manager><model name="securityManagerHttpPbeModel"><service name="securityManagerHttpPbeService"><inbound><http:inbound-endpointaddress="http://localhost:8080/audit-trail-data" synchronous="true"><mule-ss:http-security-filter realm="audit-trail"/></http:inbound-endpoint></inbound><outbound><pass-through-router><jms:outbound-endpoint address="topic://audit-data"><transformers><encrypt-transformerstrategy-ref="passwordEncryption"/></transformers></vm:outbound-endpoint></pass-through-router></outbound></service></model>6.LDAP--mule配置<spring:beans><ss:ldap-serverroot="dc=clood,dc=com"url="ldap://:389" /><ss:ldap-authentication-provideruser-dn-pattern="uid={0},ou=people"group-search-base="ou=groups"/><ss:authentication-manager alias="authenticationManager"/><mule-ss:security-manager><mule-ss:delegate-security-providername="memory-dao"delegate-ref="authenticationManager"/></mule-ss:security-manager></spring:beans>7.http策略配置<spring:beans><ss:authentication-provider><ss:user-service id="userService"><ss:user name="john" password="password" authorities="ROLE_ADMIN"/> </ss:user-service></ss:authentication-provider><ss:authentication-manager alias="authenticationManager"></spring:beans><mule-ss:security-manager><mule-ss:delegate-security-providername="memory-dao"delegate-ref="authenticationManager"/></mule-ss:security-manager><model name="httpModel"><service name="httpService"><inbound><http:inbound-endpointaddress="http://localhost:8081/secure"synchronous="true"><mule-ss:http-security-filter realm="mule"/></http:inbound-endpoint></inbound><echo-component/></service></model>8.Mule加密策略<security-manager><password-encryption-strategy name="PBE" password="password"/> </security-manager><model name="pbeModel"><service name="pbeInService"><inbound><jms:inbound-endpoint queue="messages.in"/></inbound><outbound><pass-through-router><jms:outbound-endpoint queue="services.decryption"><transformers><encrypt-transformer strategy-ref="PBE"/><jms:object-to-jmsmessage-transformer/></transformers></jms:outbound-endpoint></pass-through-router></outbound></service><service name="pbeOutService"><inbound><jms:inbound-endpoint queue="services.decryption"><transformers><jms:jmsmessage-to-object-transformer/><decrypt-transformer strategy-ref="PBE"/></transformers></jms:inbound-endpoint></inbound><outbound><pass-through-router><jms:outbound-endpoint queue="messages.out"/></pass-through-router></outbound></service></model>Spring配置<spring:bean id="pgpKeyManager"class="org.mule.module.pgp.PGPKeyRingImpl"init-method="initialise"><spring:propertyname="publicKeyRingFileName"value="conf/public.key.gpg"/><spring:propertyname="secretKeyRingFileName"value="conf/secret.key.gpg"/><spring:propertyname="secretAliasId"value="0x7927DE78"/><spring:propertyname="secretPassphrase"value="mule"/></spring:bean><spring:bean id="credentialAccessor"class="org.mule.security.MuleHeaderCredentialsAccessor"/> <pgp:security-manager><pgp:security-providername="pgpSecurityProvider"keyManager-ref="pgpKeyManager"/><pgp:keybased-encryption-strategyname="keyBasedEncryptionStrategy"keyManager-ref="pgpKeyManager"/></pgp:security-manager><model name="pgpModel"><service name="pgpService"><inbound><jms:inbound-endpointqueue="messages.encrypted" /></inbound><outbound><pass-through-router><vm:outbound-endpointpath="services.decryption"/></pass-through-router></outbound></service><service name="out"><inbound><vm:inbound-endpoint path="services.decryption"><pgp:security-filterstrategyName="keyBasedEncryptionStrategy"signRequired="true"keyManager-ref="pgpKeyManager"credentialsAccessor-ref="credentialAccessor"/></vm:inbound-endpoint></inbound><outbound><pass-through-router><jms:outbound-endpoint queue="messages.decrypted"/> </pass-through-router></outbound></service></model>。
Mule是一个企业服务总线(ESB)消息框架,而且Mule是一个轻量级且高度可扩展的ESB。
主要特性1.基于J2EE1.4的企业消息总线(ESB)和消息代理(broker).2.可插入的连接性:比如Jms,jdbc,tcp,udp,multicast,http,servlet,smt3.支持任何传输之上的异步,同步和请求响应事件处理机制.4.支持Axis或者Glue的Web Service.5.灵活的部署结构[Topologies]包括Client/Server, P2P, ESB 和Enterp6.与Spring 框架集成:可用作ESB 容器,也可以很容易的嵌入到Spring应7.使用基于SEDA处理模型的高度可伸缩的企业服务器.8.强大的基于EIP模式的事件路由机制等.9.支持声明性和编程性事务,包括XA 支持10.对事件的路由、传输和转换的断到端支持11.使用基于SEDA处理模型的高度可伸缩的企业服务器12.支持REST API 来提供技术独立和语言中立的基于web的对Mule 事件的13.动态、声明性的,基于内容和基于规则的路由选项14.非入侵式的方式。
任何对象都可以通过ESB 容器管理15.强大的应用集成框架16.完整的可扩展的开发模式更详细的介绍:/SteelHand/archive/2005/05/18/47 mule2.0发布的中文说明:/java/20080429/7664.htmlMule 2.x User Guide/display/MULE2USER/Home架构一些名词说明Transport Mule的传输层,由很多组件构成Connector连接器,负责发送和接Endpoints端点,发送和接收消息2.0版本以后端点的配Transformer转换器,负责接收和发Router路由器,在ConnectorFilter过滤器,对接收和发送UMO Components业务组件,这部分代码Inbound/Outbound消息入口、出口其他Mule作为Java ApplicationMule作为Web ApplicationMule作为ESB(Enterprise Service Network )Mule作为ESN(Enterprise Service Network )Mule Messaging Styles Mule的消息机制Asynchronous异步Request Response请求响应Synchronous同步Remote Synchronous远程同步Async Request Responsemule-2.0.1中hello例子的配置文件<?xml version="1.0" encoding="UTF-8"?><mule xmlns="/schema/mule/core/2.0"xmlns:xsi="/2001/XMLSchema-instance"xmlns:spring="/schema/beans"xmlns:stdio="/schema/mule/stdio/2.0"xmlns:vm="/schema/mule/vm/2.0"xsi:schemaLocation="/schema/beans /s /schema/mule/core/2.0 /sch /schema/mule/stdio/2.0 /sc /schema/mule/vm/2.0 /schem <description>The hello sample application has two components -1. The Greeter component that adds a greeting to the event it receives2. The ChitChater component that adds some additional conversation to the event it rece An event is triggered by input through the system console and the outbound event isaslo written out through the system console.This configuration also demonstrates user and system error handling. User error handlin an error message to the end user. System error handling logs errors.</description><!--The system stream connector is used to send and receive information via theSystem.in and System.out. Note this connector is only really useful for testingpurposes.promptMessage - is what is written to the console<outbound-pass-through-router><stdio:outbound-endpoint system="ERR"/> </outbound-pass-through-router></outbound></service></model></mule>可扩展的ESB。
MuleSoft与其产品Mule ESB产品说明书简介Mule ESB是一个基于Java的轻量级企业服务总线和集成平台,允许开发人员快速便利地连接多个应用,并支持应用间的数据交换。
Mule ESB支持集成现有系统而无论其底层采用何种技术,如JMS、Web Services、JDBC、HTTP以及其他技术。
整体结构从上图可见,Mule通过Transports/Connectors与外围的异构系统连接,提供Routing (路由)、Transaction Management(事务管理)、Transformation(转换)、Message Broker(消息代理)、Transportation Management(传输管理)、Security(安全)等核心模块。
Mule可以单独使用,也可以架设在常用的应用服务器上。
Mule ESBMule是当下使用最多的开源集成平台。
MuleESB价格低廉,配置、扩展简单,而且灵活性强,使得它非常流行。
Mule 是由MuleSoft(前身是MuleSource)开发的一个基于ESB架构理念的消息平台。
Mule ESB的核心是一个基于SEDA的服务容器,该容器管理被称为通用消息对象(Universal Message Objects /UMO)的服务对象,而这些对象都是POJO。
所有UMO和其他应用之间的通信都是通过消息端点(message endpoint)来进行的。
这些端点为众多的分立的技术,比如Jms, Smtp, Jdbc, Tcp, Http, Xmpp, file 等等,提供了简单和一致的接口。
架构说明:1.Mule主要有三个核心组件:传输器transport、路由器router、转换器transformer;2.transport负责在应用之间传递消息,router负责指导消息的传递路径,transformer负责消息格式的转换;3.可以在router中引入过滤器来针对消息内容进行过滤,实现基于内容的路由,并且只需通过xml即可完成,无需编写java代码;4.支持事务、安全、异常管理、JMX管理架构, 提供管理控制台(企业版);5.支持与Apache CXF、Spring和ActiveMQ的集成;6.提供Eclipse插件作为IDE开发Mule应用;Mule ESB的其他特性1.Mule中的组件可以是任何类型,你可以把POJO或者其他系统的组件集成进来;2.可以使用现存的任何组件而无需改变,也不需嵌入Mule的特定代码,不需调用Mule的API,业务逻辑和消息逻辑完全分离;3.消息可以是任何格式,如SOAP或二进制的图像文件;4.支持任何传输之上的异步,同步和请求响应事件处理机制.;5.Mule提供了一种简单而又强大的方式与RESfFul服务交互,即MuleRESTPack。