原创

ESB企业服务总线Apache Synapse项目搭建及启动服务

Apache Synapse是一种轻量级的高性能企业服务总线ESB,适用于Synapse的广泛的传输适配器使其能够通过许多应用和传输层协议进行通信。支持HTTP / S,邮件(POP3,IMAP,SMTP),JMS,TCP,UDP,VFS,SMS,XMPP和FIX。


Apache Synapse的最新稳定版本是3.0.0,官方建议升级至最新版。下面讲述一下如何利用Apache Synapse源码搭建服务,下载synapse-3.0.0-src.zip 源代码,下载地址http://synapse.apache.org/download/3.0.0/download.cgi,解压导入eclipse生成如下项目结构,如图: 

blob.png


官方建议Java运行时使用1.6.0_23或更高版本的JDK或JRE,本人采用的是jdk1.7.0_17版本,将所有项目转换成JDK1.7,需要修改三处JDK参数,“Project Facets”不存在JDK选项时无需设置,如图:

blob.png


在eclipse中选中项目分别执行maven clean和maven install命令,然后执行mvn assembly:assembly -Drelease来生成二进制分发,如图:

blob.png


将所有项目编译通过后,打开..\synapse-3.0.0-src\modules\distribution\target目录,会生成服务包,然后将synapse-3.0.0-bin.zip解压运行bin目录命令synapse.bat,控制台如下:

F:\synapse-3.0.0\bin>synapse.bat

"Starting Synapse/Java ..."

Using SYNAPSE_HOME:        F:\SYNAPS~1.0\bin\..

Using JAVA_HOME:       E:\Java\jdk1.7.0_17

--> Wrapper Started as Console

Launching a JVM...

Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org

  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.



WARNING - Unable to load the Wrapper's native library because none of the

          following files:

            wrapper-windows-x86-64.dll

            wrapper.dll

          could be located on the following java.library.path:

            F:\SYNAPS~1.0\lib

          Please see the documentation for the wrapper.java.library.path

          configuration property.

          System signals will not be handled correctly.


2017-04-27 15:57:43,579 [-] [WrapperSimpleAppMain]  INFO SynapseServer Starting Apache Synapse...

2017-04-27 15:57:43,595 [-] [WrapperSimpleAppMain]  INFO SynapseControllerFactory Using Synapse home : F:\SYNAPS~1.0\.

2017-04-27 15:57:43,595 [-] [WrapperSimpleAppMain]  INFO SynapseControllerFactory Using Axis2 repository : F:\SYNAPS~1.0\repository

2017-04-27 15:57:43,610 [-] [WrapperSimpleAppMain]  INFO SynapseControllerFactory Using axis2.xml location : F:\SYNAPS~1.0\repository\conf\axis2.xml

2017-04-27 15:57:43,610 [-] [WrapperSimpleAppMain]  INFO SynapseControllerFactory Using synapse.xml location : F:\SYNAPS~1.0\bin\..\repository\conf\synapse-config

2017-04-27 15:57:43,610 [-] [WrapperSimpleAppMain]  INFO SynapseControllerFactory Using server name : localhost

2017-04-27 15:57:43,610 [-] [WrapperSimpleAppMain]  INFO SynapseControllerFactory The timeout handler will run every : 15s

2017-04-27 15:57:43,673 [-] [WrapperSimpleAppMain]  INFO Axis2SynapseController Initializing Synapse at : Thu Apr 27 15:57:43 CST 2017

2017-04-27 15:57:44,380 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLSender Loading Identity Keystore from : lib/identity.jks

2017-04-27 15:57:44,411 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLSender Loading Trust Keystore from : lib/trust.jks

2017-04-27 15:57:44,489 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLSender Pass-through HTTPS sender started...

2017-04-27 15:57:44,489 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSender Pass-through HTTP sender started...

2017-04-27 15:57:44,489 [-] [WrapperSimpleAppMain]  INFO JMSSender JMS Sender started

2017-04-27 15:57:44,505 [-] [WrapperSimpleAppMain]  INFO JMSSender JMS Transport Sender initialized...

2017-04-27 15:57:44,505 [-] [WrapperSimpleAppMain]  INFO VFSTransportSender VFS Sender started

2017-04-27 15:57:44,701 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLListener Loading Identity Keystore from : lib/identity.jks

2017-04-27 15:57:44,701 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLListener Loading Trust Keystore from : lib/trust.jks

2017-04-27 15:57:44,733 [-] [WrapperSimpleAppMain]  INFO Axis2SynapseController Loading mediator extensions...

2017-04-27 15:57:44,748 [-] [WrapperSimpleAppMain]  INFO MultiXMLConfigurationBuilder Building synapse configuration from the synapse artifact repository at : F:\SYNAPS~1.0\bin\..\repository\conf\synapse-config

2017-04-27 15:57:44,764 [-] [WrapperSimpleAppMain]  INFO XMLConfigurationBuilder Generating the Synapse configuration model by parsing the XML configuration

2017-04-27 15:57:44,913 [-] [WrapperSimpleAppMain]  INFO SynapseConfigurationBuilder Loaded Synapse configuration from the artifact repository at : F:\SYNAPS~1.0\bin\..\repository\conf\synapse-config

2017-04-27 15:57:44,913 [-] [WrapperSimpleAppMain]  INFO Axis2SynapseController Deploying the Synapse service...

2017-04-27 15:57:44,944 [-] [WrapperSimpleAppMain]  INFO Axis2SynapseController Deploying Proxy services...

2017-04-27 15:57:44,944 [-] [WrapperSimpleAppMain]  INFO Axis2SynapseController Deploying EventSources...

2017-04-27 15:57:44,960 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLListener Starting pass-through HTTPS listener...

2017-04-27 15:57:44,991 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpSSLListener Pass-through HTTPS listener started on port: 8243

2017-04-27 15:57:44,991 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpListener Starting pass-through HTTP listener...

2017-04-27 15:57:44,991 [-] [WrapperSimpleAppMain]  INFO PassThroughHttpListener Pass-through HTTP listener started on port: 8280

2017-04-27 15:57:44,991 [-] [WrapperSimpleAppMain]  INFO Axis2SynapseController Management using JMX available via: service:jmx:rmi:///jndi/rmi://hdnav-pc:1099/synapse

2017-04-27 15:57:44,991 [-] [WrapperSimpleAppMain]  INFO TimeoutHandler This engine will expire all callbacks after : 180 seconds, irrespective of the timeout action, after the specified or optional timeout

2017-04-27 15:57:45,007 [-] [WrapperSimpleAppMain]  INFO ServerManager Server ready for processing...

2017-04-27 15:57:45,007 [-] [WrapperSimpleAppMain]  INFO SynapseServer Apache Synapse started successfully

如果控制台输出“INFO SynapseServer Apache Synapse started successfully”信息,表示启动成功。

ESB企业服务总线 Apache Synapse 体系结构和新功能,参考资料:

http://blog.yoodb.com/yoodb/article/detail/1314

关注下方微信公众号“Java精选”(w_z90110),回复关键字领取资料:如HadoopDubboCAS源码等等,免费领取资料视频和项目。 

涵盖:程序人生、搞笑视频、算法与数据结构、黑客技术与网络安全、前端开发、Java、Python、Redis缓存、Spring源码、各大主流框架、Web开发、大数据技术、Storm、Hadoop、MapReduce、Spark、elasticsearch、单点登录统一认证、分布式框架、集群、安卓开发、iOS开发、C/C++、.NET、Linux、Mysql、Oracle、NoSQL非关系型数据库、运维等。

评论

分享:

支付宝

微信