最新公告:goCom系统调整暂停注册,若需注册请访问gocom.cc地址进行操作。请点击此处
 
  网站地图
  
  高级搜索
  首页   技术论坛   博客 派计划   产品中心   资源中心   银弹在线   商城  





Apache Synapse ESB 初探    
#1楼
给作者发送短消息 给作者发送短消息 实名会员 
查看用户其他信息
总分 237 分
财富 460 goCom币
威望 142
排名 第 74 名
段位 新手必读
Synapse其实是一个 解耦的模型,你不用特意为他准备什么,只要是想用就可以用了。比如,自己的系统中,已经发布了Web Services,现在需要上个ESB,如果你使用Synapse,你只是需要简单配置一下,你的服务的endpoint,然后启动synapse服务 器,你的服务地址就已经注册到了Synapse里面了,其他的程序可以直接通过Synapse新地址访问你之前的服务了。

Apache Synapse ESB 初探


Apache Synapse is designed to be a simple, lightweight and high performance Enterprise Service Bus (ESB) from Apache. Based on a small asynchronous core, Apache Synapse has excellent support for XML and Web services - as well as binary and text formats. The Synapse engine is configured with a simple XML format and comes with a set of ready-to-use transports and mediators. We recommend you start by reading the QuickStart and then trying out the samples. Synapse is made available under the Apache Software License 2.0.



上面是段官方网站的介绍,我直接就复制一下了。



接 下来说说,我对Synapse ESB的感觉吧。Synapse是基于Axis2的一个企业服务总线,在Web Services的使用上面和Axis2一个样,没什么区别。其他的通讯协议,我还没有试呢,估计应该也差不多,(通用接口嘛)。 Synapse没有图形界面,都纯手工的写代码,写配置。ESB的流程控制,都要自己在synapse.xml手工输入。有点像OSWorkflow的做 法,我觉得,这样的操作对于程序员来说非常好的,一切都是白盒的。



Synapse其实是一个 解耦的模型,你不用特意为他准备什么,只要是想用就可以用了。比如,自己的系统中,已经发布了Web Services,现在需要上个ESB,如果你使用Synapse,你只是需要简单配置一下,你的服务的endpoint,然后启动synapse服务 器,你的服务地址就已经注册到了Synapse里面了,其他的程序可以直接通过Synapse新地址访问你之前的服务了。



再简单地描述一下:

我的自有系统发布成功的Web Services

http://localhost:8088/HelloESB1/services/Hello?wsdl



加入SynapseESB,修改配置文件,synapse.xml

<definitions xmlns="http://ws.apache.org/ns/synapse">

    <proxy name="Hello">

        <target>

            <endpoint>

                <address uri="http://localhost:8088/HelloESB1/services/Hello"/>

            </endpoint>

            <outSequence>

                <send/>

            </outSequence>

        </target>

        <publishWSDL uri="http://localhost:8088/HelloESB1/services/Hello?wsdl"/>

    </proxy>

</definitions>



我的SynapseESB启动的port是8080, 打开浏览器,访问:http://localhost:8080/soap/Hello?wsdl

发现就是我之前的Web services.



这个Web Services其实在启动的时候,就已经在Synapse注册了。如果我需要做一些其他的操作,可以直接在
synapse.xml里面进行修改。



最后,通过新的发布地址http://localhost:8080/soap/Hello?wsdl,生成客户端访问程序。



是不是很简单呢,并且与自己的程序是分离的,完全的分离!






参考文章:

http://gocom.primeton.com/modules/newbb/forumtopic27365_8498_63.htm(中文的入门介绍)

http://synapse.apache.org/index.html(官方网站)


 




发表回复
账号用户名   密码   登录
内容:url email imgsrc image code quote
范例 Example
bold italic underline linethrough   


 [更多...]