2013年2月23日星期六

FuseESB Enterprise/ServiceMix安装配置

[ZT]http://www.myexception.cn/software-architecture-design/427047.html

ServiceMix安装配置:
1. 安装准备
    apache-servicemix-4.4.1-fuse-01-13.zip
    jdk.1.6.0_30(Java5不支持)
    Maven3.0.3
2. 安装配置
    解压apache-servicemix-4.4.1-fuse-01-13.zip至:C:\Apache-servicemix-4.4.1-fuse-01-13.

    默认解压后启动ServiceMix时,JBI容器时做为FuseESB的OSGi容器的一个子容器的,如果要禁用该功能,
    可进行下面的设置:
    (1) 如果已经启动过ServiceMix, 则需要删除安装目录下的data 文件夹;
    (2) 编辑etc/org.apache.karaf.features.cfg 文件,删除featuresBoot 属性中所有匹配
          jbi-*或servicemix-* 模式的值。
    (3) 重启ServiceMix。

    FuseESB默认采用的OSGi Framework是Equinox, 也可以改变为Fleix:
    修改etc/config.properties文件中的karaf.framework 属性为:felix即可。
3. 启动
    进入C:\Apache-servicemix-4.4.1-fuse-01-13\bin下,执行servicemix.bat;
4. 停止
    执行命令:
    osgi:shutdown或shutdown或Ctrl+D
5. 常见命令
    获取所有可用的命令:Tab;
    获取某一组下的可用命令:组标示符Tab(中间无空格), 如获取osgi组下的所有命令:osig"PressTab"
    获取某个命令的帮助:命令 --help, 如获取osig:shutdown命令帮助:osgi:shutdown --help
    查看FuseESB提供的例子的特性:features:list | grep examples
    安装某个例子特性:features:install examples-cxf-osgi
6. WebConsole
    默认情况下,WebConsole没有安装,可通过下面的命令检查是否安装:
    features:list | grep webconsole
    通过下面的命令进行安装:
    features:install webconsole
    浏览器访问路径:http://localhost:8181/system/console
    (1) 客制化端口:修改etc/org.ops4j.pax.web.cfg.empty.stub中: org.osgi.service.http.port=8181;

[NOTE] Different way to change http port number (from official site):

By default, the console runs on port 8181. You can change the port number by creating the properties file, etc/org.ops4j.pax.web.cfg, and adding the following property setting (changing the port number to whatever value desired):
org.osgi.service.http.port=8181


    (2) 客制化登录控制台用户名密码:修改etc/users.properties 文件, 默认用户名密码为:smx/smx.
7. 案例:部署WebService至FuseESB
    (1) 打包:
    cd C:\Apache-servicemix-4.4.1-fuse-01-13\examples\cxf-osgi
    mvn install
    执行该命令后将在当前目录产生target文件夹,并生成cxf-osgi-4.4.1-fuse-01-13.jar。
    (2) 部署:
    复制cxf-osgi-4.4.1-fuse-01-13.jar至ServiceMix安装目录的deploy 目录下;
    (3) 测试:
    查看WSDL文件:http://localhost:8181/cxf/HelloWorld?wsdl
    执行测试客户端:
    cd C:\Apache-servicemix-4.4.1-fuse-01-13\examples\cxf-osgi
    mvn compile exec:java
    执行结果:
    the response is =====>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body>
             <ns2:sayHiResponse xmlns:ns2="http://cxf.examples.servicemix.apache.org/">
                  <return>Hello John Doe </return>
             </ns2:sayHiResponse>
         </soap:Body>
    </soap:Envelope>
8. 配置Eclipse Plugin:CIMERO及FuseIDE
    CIMERO :Configuration Interface for Message Routing, 一款针对与ServiceMix的Eclipse可视化工具。
    参考:http://servicemix.apache.org/cimero-editor.html
    FuseIDE : is a graphical, Eclipse-based tool for integrating software components that works
    withApache ServiceMix , Apache ActiveMQ , Apache Camel , and the FuseSource distributions.
    参考:http://fusesource.com/products/fuse-ide/
    安装:http://repo.fusesource.com/ide/

FuseESB Enterprise安装配置:
1. 安装需求:JDK1.6.0_18 or later,不支持Java5.
2. 环境变量:
    export JAVA_HOME=/usr/lib/jvm/java-1.6.0_30
    export M2_HOME=/opt/maven
    export PATH=$JAVA_HOME/bin:$PATH
    export PATH=$M2_HOME/bin:$PATH
    export MAVEN_OPTS=-Xmx512M
3. 下载安装:
    Fuse-ESB-Enterprise-7.0.0.fuse-beta-052-windows-installer.exe
    双击执行安装。
4. 启动ESB(Linux):
     (1) 启动方式1:进入安装目录下的bin目录下,执行:./fuseesb
     (2) 启动方式2-Server Mode:进入安装目录下的bin目录下,执行:./fuseesb server
     (3) 启动方式3-Client Mode: 进入安装目录下的bin目录下,执行:./fuseesb client
5. 关闭ESB(Linux):
     (1) Client或默认方式下启动时:shutdown -f或Ctrl+d;
     (2) Server方式下启动时:进入安装目录下的bin目录下,执行:./stop或./stop admin instanceName
     (3) 如果etc/org.apache.karaf.shell.cfg配置文件中的sshHost不是默认值:0.0.0.0,在关闭ESB时需要使用下
     面的方式:./stop -h hostName

没有评论:

发表评论