日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

ESB服務(wù)總線

 開(kāi)心豆豆2010 2013-11-15

1      總線

1.1    MULE與ServiceMix比較分析

1.1.1   JBI標(biāo)準(zhǔn)

JBI標(biāo)準(zhǔn)是以請(qǐng)求消息和響應(yīng)消息為切入點(diǎn),在集成時(shí)將消息和傳輸協(xié)議解耦,形成一種與傳輸協(xié)議無(wú)關(guān)的消息標(biāo)準(zhǔn),是一種集成容器模型。ServiceMix是JBI標(biāo)準(zhǔn)的實(shí)現(xiàn),而Mule并非基于JBI標(biāo)準(zhǔn)實(shí)現(xiàn)服務(wù)集成,但是支持?jǐn)U展成JBI標(biāo)準(zhǔn)。

JBI的目標(biāo)在于建立一種Java組件集成的運(yùn)行環(huán)境。

由三部分組成:

l  綁定組件(Binding Components):專門(mén)接收各類傳輸協(xié)議。

l  服務(wù)引擎(Service Engines):專門(mén)處理各種傳輸和協(xié)議轉(zhuǎn)換、BPEL專門(mén)負(fù)責(zé)webservice流程編排、支持通過(guò)規(guī)則集成各種服務(wù)。

l  規(guī)格化消息路由(Normalized Message Router):消息標(biāo)準(zhǔn)化,并統(tǒng)一路由分發(fā)。

 

  

圖1-1 JBI架構(gòu)服務(wù)集成原理

1.1.2   ServiceMix

ServiceMix是基于JBI架構(gòu)的ESB項(xiàng)目,最新版本servicemix4。如下圖示,它是由Apache旗下的多個(gè)軟件組合而成的。

Apache ODE——實(shí)現(xiàn)BPEL引擎;

Apache Camel——實(shí)現(xiàn)基于規(guī)則的消息路由,可以用DSL去開(kāi)發(fā)集成流程;

Apache Felix——是一個(gè)OSGi版本4規(guī)范的Apache實(shí)現(xiàn)

 

特點(diǎn):

l  基于JBI規(guī)范,模塊結(jié)構(gòu)功能分明,但是開(kāi)發(fā)配置復(fù)雜,且文檔和demo不夠豐富;

l  源代碼不易獲得,并且因?yàn)樯婕暗蕉鄠€(gè)開(kāi)源項(xiàng)目,若需要自助升級(jí)擴(kuò)展某項(xiàng)功能則會(huì)較為復(fù)雜;

l  所有消息都需要被統(tǒng)一轉(zhuǎn)換成標(biāo)準(zhǔn)消息后再做處理(對(duì)于不需要轉(zhuǎn)換的消息來(lái)說(shuō)存在多于環(huán)節(jié)),因此性能比Mule差;

l  支持OSGI熱部署。

1.1.3   Mule

Mule是最早的開(kāi)源ESB軟件之一,比較輕量,最新版本是3.1.1。Mule的整體架構(gòu)如圖示包括幾部分:

1、被集成的應(yīng)用(Application);

2、通道(channel):集成外部應(yīng)用與Mule進(jìn)行消息交互;

3、消息接收器(Message receiver):從通道接受消息;

4、連接器(Connector):在接收端和發(fā)送端,知道如何把數(shù)據(jù)發(fā)送給通道或者從通道接受消息,消息接收器就屬于連接器的一部分;

5、消息轉(zhuǎn)換器(Transformer):對(duì)消息格式進(jìn)行轉(zhuǎn)換;

6、入站路由(Inbouxnd router):從通道接收入口消息的地址以及接收后對(duì)消息進(jìn)行的處理;

7、組件(Component):處理集成邏輯的組件,可以用POJO,Groovy,Script,BPM,REST Service等技術(shù);

8、出站路由(Outbound router):決定被集成組件處理過(guò)的消息要發(fā)送到哪里去;

9、消息分發(fā)器(Message dispatcher):正好和消息接收器相反,處理如何將消息分發(fā)給通道;

 

特點(diǎn):

l  模塊結(jié)構(gòu)功能分明,具有IDE開(kāi)發(fā)工具、開(kāi)發(fā)配置簡(jiǎn)單,且可參考的文檔和demo豐富;

l  消息的處理過(guò)程可靈活配置,僅在必要時(shí)可以通過(guò)Transformer組件轉(zhuǎn)換處理消息,效率較基于JBI標(biāo)準(zhǔn)的ServiceMix要好;

l  不支持OSGI熱部署;

l  能夠獲得完整的源代碼,自主升級(jí)擴(kuò)展要比ServiceMix容易。

 

1.2    MULE功能

1.2.1   MULE功能描述

Mule是開(kāi)源企業(yè)服務(wù)總線,是企業(yè)應(yīng)用集成工具的集合。Mule主要使用XML配置實(shí)現(xiàn)多個(gè)企業(yè)應(yīng)用的整合,并提供靈活的機(jī)制,實(shí)現(xiàn)基于消息的數(shù)據(jù)路由,傳輸和不同系統(tǒng)之間的轉(zhuǎn)換。通俗的說(shuō)Mule的集成功能主要實(shí)現(xiàn)了下述功能:

1)       實(shí)現(xiàn)跨系統(tǒng)的服務(wù)調(diào)用;

2)       基于跨系統(tǒng)的服務(wù),實(shí)現(xiàn)一定的業(yè)務(wù)邏輯;

3)       基于多種類型的消息通道,實(shí)現(xiàn)多個(gè)系統(tǒng)間的消息通信;

4)       支持對(duì)多種開(kāi)源軟件的集成。

1.2.1.1 Mule 支持三種部署方式:

1)     可獨(dú)立部署;

2)     可和web應(yīng)用一起部署到應(yīng)用服務(wù)器;

3)     可和Java應(yīng)用一起部署。

1.2.1.2 Mule提供了開(kāi)發(fā)向?qū)Р寮?/h4>

能夠集成到Eclipse環(huán)境,便于創(chuàng)建Mule項(xiàng)目以及調(diào)試。

1.2.1.3 配置方式:

1)       Mule主要是基于XML配置服務(wù)、流程及轉(zhuǎn)換邏輯,能夠通過(guò)配置文件清晰的表現(xiàn)整個(gè)集成邏輯以及調(diào)用關(guān)系;

2)       同時(shí)Mule支持基于annotation創(chuàng)建集成服務(wù)對(duì)象,包括創(chuàng)建業(yè)務(wù)邏輯組件和消息轉(zhuǎn)換類,可簡(jiǎn)化一部分XML配置工作。

l  Mule支持對(duì)Webservice 的集成

1)       已經(jīng)整合了CXF和AIXS發(fā)布服務(wù)的功能,能支持自動(dòng)基于CXF或者AIXS發(fā)布WebService,并支持利用服務(wù)作為邏輯處理組件的功能。

2)       支持基于一定的業(yè)務(wù)邏輯,對(duì)webservice的代理訪問(wèn);

3)       支持將webservice的包裝成集成邏輯處理組件。

1.2.1.4 整合邏輯定義模式

Mule提供了多種服務(wù)整合的模式,包括如下幾種:

1)       Service模式: Mule服務(wù)是一種集成機(jī)制,它基于一些入站路由端點(diǎn)、單個(gè)業(yè)務(wù)邏輯處理組件和一些出站路由和端點(diǎn)提供了一種固定的集成框架模式。為了實(shí)現(xiàn)復(fù)雜的路由或處理鏈,通常需要通過(guò)Mule提供的VM queue將多個(gè)Mule服務(wù)聯(lián)系起來(lái)。

2)       Flow模式:流模式是Mule3提供的新功能,官方文檔稱它是一種既簡(jiǎn)單又靈活的集成機(jī)制,它能夠?qū)崿F(xiàn)復(fù)雜的服務(wù)集成業(yè)務(wù)流。Mule提供了基礎(chǔ)的流構(gòu)建模塊,你可以很容易的基于這些基礎(chǔ)的流模塊實(shí)現(xiàn)集成的業(yè)務(wù)流功能。

3)       A configuration pattern:

1.2.1.5 異常處理

對(duì)Mule 3 分別針對(duì)以下兩種場(chǎng)景提供了異常處理接口,只需要實(shí)現(xiàn)該接口即可編寫(xiě)集成過(guò)程中的異常處理邏輯:

1)       一種是消息處理異常,例如消息路由或者消息b轉(zhuǎn)換異常;

2)       另一種是不涉及到消息的異常,例如連接異?;蛘叱跏蓟惓5?/p>

1.2.1.6 支持事務(wù)管理

Mule的事務(wù)框架不區(qū)分對(duì)待事務(wù)的類型,一個(gè)事務(wù)可能是一個(gè)JDBC事務(wù),XA事務(wù),或JMS交易或消息的確認(rèn),所有類型的事務(wù)都可以以同樣的方式處理。Mule可以在事務(wù)端點(diǎn)上配置同步,其中一個(gè)端點(diǎn)可以配置為啟動(dòng)新的事務(wù)或加入一個(gè)現(xiàn)有的事務(wù)。在一個(gè)端點(diǎn)上配置事務(wù)使用<transaction>,它映射到org.mule.transaction.MuleTransactionConfig類。這個(gè)元素定義了一個(gè)端點(diǎn)應(yīng)采取的行動(dòng)時(shí),收到一個(gè)事件和事務(wù)工廠用于創(chuàng)建事務(wù)。

1.2.1.7 支持規(guī)則表達(dá)式

規(guī)則表達(dá)式可以從當(dāng)前的消息中獲取一些決定如何處理消息的邏輯標(biāo)識(shí)信息,對(duì)于定義路由邏輯或者過(guò)濾不需要的消息非常有用。Mule提供了幾種默認(rèn)的規(guī)則處理方式,你也可以擴(kuò)展創(chuàng)建自己的規(guī)則處理方式以支持其他編程語(yǔ)言。

1.2.1.8 支持安全

Mule ESB支持使用傳輸級(jí)的或一般的驗(yàn)證方法來(lái)驗(yàn)證到達(dá)端點(diǎn)的服務(wù)請(qǐng)求。另外Mule還提供了對(duì)服務(wù)組件進(jìn)行方法級(jí)的控制授權(quán)。Mule的安全管理器用于驗(yàn)證基于一個(gè)或多個(gè)安全供應(yīng)商技術(shù)的安全請(qǐng)求。所有的安全功能都是通過(guò)Mule的安全API實(shí)現(xiàn)的,這樣可以很容易地實(shí)現(xiàn)安全功能的可插拔的。

1.2.1.9 云連接器

Mule云連接器是一種基于Mule使用SAAS服務(wù)、社會(huì)媒體或電子商務(wù)服務(wù)的輕量工具集,云連接器在這些服務(wù)上建立了一個(gè)層,來(lái)簡(jiǎn)化對(duì)這些服務(wù)的負(fù)載均衡調(diào)用。云連接器為Mule的傳輸通道提供了一種替代類型的連接器,傳輸通道典型的代表消息的通信協(xié)議,而云連接則更適合將mule連接到一個(gè)應(yīng)用的API,該應(yīng)用基于Mule已經(jīng)支持的底層協(xié)議的上層。

1.2.1.10        支持多種類型的傳輸通道

在Mule框架中的傳輸通道,負(fù)責(zé)將消息從一個(gè)應(yīng)用傳輸?shù)搅硗庖粋€(gè)應(yīng)用。每種通道針特定的通道,提供一套功能消息出力功能,例如HTTP通道就能夠處理基于Http協(xié)議的消息,而文件通道就能夠從服務(wù)器文件系統(tǒng)中獲取文件信息。Mule3.0主要支持如下表所示的傳輸通道類型:

 

                                                                                                                                                                                                                                   
 

序號(hào)

 
 

通道類型

 
 

說(shuō)明

 
 

1.            

 
 

Ajax傳輸通道

 
 

使得Mule時(shí)間能夠異步的和Web瀏覽器交互 。

 
 

2.            

 
 

JBPM集成

 
 

Allows Mule  events to initiate and/or advance processes in a Business Process Management  System (BPMS) a.k.a. Process Engine.

 
 

3.            

 
 

CXF Modules

 
 

Provides support  for web service integration via Apache CXF. Includes a WSDL connector that  invokes remote web services by obtaining the service WSDL.

 
 

4.            

 
 

EJB通道

 
 

Allows EJB  invocations to be made using outbound endpoints.

 
 

5.            

 
 

Email傳輸通道

 
 

This transport  supplies various email connectivity options.

 
 

6.            

 
 

File Transport Reference

 
 

File  Transport  This transport allows files  to be read and written to directories on the local file system. The connector  can be configured to filter the file it reads and the way files are written,  such as whether binary output is used or the file is appended to.

 
 

7.            

 
 

FTP Transport

 
 

 Allows files to be read / written to a  remote FTP server. 

 
 

8.            

 
 

HTTP Transport

 
 

his transport  supplies HTTP transport of Mule messages between applications and other Mule  servers.

 
 

9.            

 
 

HTTPS Transport

 
 

A secure version of the HTTP transport.

 
 

10.          

 
 

IMAP Transport

 
 

Connectivity to  IMAP mail folders. 

 
 

11.          

 
 

IMAPS Transport

 
 

A secure version  of the IMAP transport. 

 
 

12.          

 
 

JCR

 
 

A transport that  reads from, writes to, and observes JCR 1.0 containers. This transport is  available on MuleForge.

 
 

13.          

 
 

JDBC Transport

 
 

A transport for JDBC connectivity. Some of  its features are available only in Mule Enterprise.

 
 

14.          

 
 

Jersey Module

 
 

Adds support for  the JSR-311 implementation Jersey, which makes it possible to build RESTful  services via a few simple annotations.

 

 

 
 

15.          

 
 

Jetty Transport

 
 

Provides support  for exposing services over HTTP by embedding a light-weight Jetty server. For  inbound endpoints only.

 

 

 
 

16.          

 
 

Jetty SSL

 
 

A secure version  of the Jetty transport.

 
 

17.          

 
 

JMS Transport

 
 

A Mule transport for JMS connectivity.  Mule itself is not a JMS server but can use the services of any JMS 1.1 or  1.02b compliant server such as ActiveMQ and OpenJms, and commercial vendors  such as Weblogic, SonicMQ, and more.

 
 

18.          

 
 

LDAP Transport

 
 

Allows you to send and receive Mule  Messages to/from an LDAP directory.

 
 

19.          

 
 

Legs4Mule  Transport

 
 

Provides transformers and connectors for  IBM mainframes.

 
 

20.          

 
 

Multicast  Transport

 
 

Allows your components to receive and send  events via IP multicast groups.

 
 

21.          

 
 

POP3 Transport

 
 

Connectivity to  POP3 inboxes. 

 
 

22.          

 
 

POP3S Transport

 
 

A secure version of the POP3 transport.

 
 

23.          

 
 

Quartz Transport

 
 

Quartz Transport  Provides scheduling facilities with cron /  interval definitions and allows Mule events to be scheduled/rescheduled.

 
 

24.          

 
 

Restlet  Transport

 
 

Allows you to embed Restlet services  inside of Mule, use the Restlet client API over Mule, and use URI templates  to route messages inside of Mule.

 
 

25.          

 
 

RMI Transport

 
 

Enables events to be sent and received  over RMI via JRMP.

 
 

26.          

 
 

Servlet Transport

 
 

Provides facilities for Mule components to  listen for events received via a servlet request. There is also a servlet  implementation that uses the Servlet transport to enable REST style services  access. This transport is now bundled with the HTTP transport.

 
 

27.          

 
 

SMTP Transport

 
 

Connectivity to  SMTP servers. 

 
 

28.          

 
 

SMTPS Transport

 
 

A secure version  of the SMTP transport. 

 
 

29.          

 
 

SSL Transport

 
 

Provides secure  socket-based communication using SSL or TLS.

 
 

30.          

 
 

STDIO Transport

 
 

This transport provides connectivity to  streams such as System.in and System.out and is useful for testing. 

 
 

31.          

 
 

TCP Transport

 
 

Enables events to be sent and received  over TCP sockets.

 
 

32.          

 
 

TLS Transport

 
 

Provides secure  socket-based communication using SSL or TLS.  

 
 

33.          

 
 

UDP Transport  Reference

 
 

Enables events to be sent and received as  datagram packets.

 
 

34.          

 
 

VM Transport

 
 

Enables event sending and receiving over  VM, embedded memory, or persistent queues.

 
 

35.          

 
 

WebSphere MQ  Transport

 
 

A Mule transport for WebSphere MQ. This  transport is available with Mule Enterprise version 1.6 and later.

 
 

36.          

 
 

WSDL Connectors

 
 

The CXF Module allows remote web services  to be invoked using their WSDL contract.  

 
 

37.          

 
 

XMPP Transport(可擴(kuò)展通訊和表示協(xié)議)

 
 

Provides connectivity over the XMPP  (Jabber) instant messaging protocol.

 

 

1.2.2   MULE功能實(shí)現(xiàn)方式及舉例

本小節(jié)主要從以下幾個(gè)方面針對(duì)Mule的具體開(kāi)發(fā)及配置方式做簡(jiǎn)要說(shuō)明。

1.2.2.1 Mule 支持的常用部署方式

1.        獨(dú)立部署方式:

a)        到Mule的官方網(wǎng)站上下載一個(gè)Mule-standalone-3.x.x的壓縮包,到服務(wù)器上解壓到安裝目錄;

b)       配置環(huán)境變量MULE_HOME;

c)        若使用MAVEN則配置MAVEN_OPTS “-Xmx512m -XX:MaxPermSize=256”

d)       進(jìn)入MULE_HOME/bin目錄下運(yùn)行mule -config your-config.xml(基于your-config.xml文件啟動(dòng)mule服務(wù));

e)        把獨(dú)立的集成項(xiàng)目工程文件放到MULE_HOME/apps下,例如hellomule;

a)        無(wú)需重啟mule服務(wù),mule服務(wù)能夠自動(dòng)找到新部署的集成項(xiàng)目,訪問(wèn)站點(diǎn) :       http://localhost:8888/?name=ross出現(xiàn)信息如下信息即部署成功:   Hello ross, how are you?

 

     2、部署到WEB應(yīng)用服務(wù)器上

b)       把mule下面的lib下面所有的jar包c(diǎn)opy到tomcat的lib包下面(需要到目錄中尋找),如:\Tomcat6.0\webapps\mule-test\WEB-INF\lib

c)        把 \mule-standalone-3.1.1\apps\mule-example-hello-3.1.1\*  copy到tomcat具體某個(gè)app的WEB-INF中,如:Tomcat6.0\webapps\mule-test\WEB-INF

d)       修改web.xml添加如下內(nèi)容:

                 <context-param>

                    <param-name>org.mule.config</param-name>

                  <param-value>/WEB-INF/mule-config.xml</param-value>

                     </context-param>

                     <listener>

                           <listener-class>

org.mule.config.builders.MuleXmlBuilderContextListener

</listener-class>

                     </listener>

e)        啟動(dòng)tomcat, 可以看到控制臺(tái)有mule啟動(dòng)加載信息輸出;

f)        訪問(wèn)站點(diǎn) :  http://localhost:8888/?name=ross出現(xiàn)信息如下信息即成功:   Hello ross, how are you?

 

稍侯將附上 Mule與Tomcat進(jìn)行web結(jié)合的文章

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多