3、 jms provider
因为首先需要一个jms服务器,所以首先我们需要搭建一个jms服务器,这里我们选用了openjms
其使用参考 JMS服务器openJms入门
在conf下创建 配置文件 test-jms-config.xml ,内容如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mule-configuration PUBLIC "-//SymphonySoft //DTD mule-configuration XML V1.0//EN"
"http://www.symphonysoft.com/dtds/mule/mule-configuration.dtd">
<!-- This is the configuration for the Loan Broker ESB example -->
<!-- See http://mule.codehaus.org/LoanBroker for more information, diagrams and even a presentation! -->
<mule-configuration id="Mule_JMS" version="1.0">
<description>
Mule_JMS
</description>
<connector name="jmsConnector" className="org.mule.providers.jms.JmsConnector">
<properties>
<property name="specification" value="1.1"/>
<property name="jndiDestinations" value="true"/>
<property name="forceJndiDestinations" value="true"/>
<property name="connectionFactoryJndiName" value="ConnectionFactory"/>
<property name="jndiInitialFactory" value="org.exolab.jms.jndi.InitialContextFactory"/>
<property name="jndiProviderUrl" value="tcp://localhost:3035"/>
</properties>
</connector>
<transformers>
<transformer name="JMSMessageToString"
className="org.mule.providers.jms.transformers.JMSMessageToObject"
returnClass="java.lang.String" />
<transformer name="HttpRequestToString" className="org.mule.samples.hello.HttpRequestToString"/>
</transformers>
<mule-descriptor name="jmsConnector" implementation="test.Service">
<inbound-router>
<endpoint address="jms://queue1" transformers="JMSMessageToString"/>
</inbound-router>
</mule-descriptor>
</mule-configuration>
在bin下创建批处理文件 testjms.bat ,其内容如下:
@echo off
REM There is no need to call this if you set the MULE_HOME in your environment properties
if "%MULE_HOME%" == "" SET MULE_HOME=..\..
REM Set your application specific classpath like this
SET CLASSPATH=%MULE_HOME%\samples\testmule\conf;%MULE_HOME%\samples\testmule\WebRoot\WEB-INF\classes;
SET CUSTOM_LIB=E:\java\openjms-0.7.7-alpha-3\lib
call %MULE_HOME%\bin\mule.bat -config ../conf/test-jms-config.xml
SET CLASSPATH=
特别注意红字部分,需要指定openjms的lib地址
然后我们启动openjms,再执行 testjms.bat ,然后用openjms的客户端测试工具发送消息,则能看到mule后台监测到的信息,会自动接收到mule里。
其他的如 jdbc,mail,xxmp基本上都是这种思路来实现的,当然要注意transform的配置,因为很多信息需要转换才能正常显示接收的
<!--EndFragment-->
分享到:
相关推荐
博文链接:https://hideto.iteye.com/blog/65607
博文链接:https://hideto.iteye.com/blog/65822
mule in aciton:mule 实战,主要是社区成熟,文档丰富。开源esb
企业服务总线ESB中用户数量大,文档丰富,社区成熟的一款开源ESB。
MULE用户指南3.3 官方原版
mule in action ,mule入门教程,系统学习资料,英文版
用户数最多 社区最活跃的开源框架 企业服务总线 虽然没有实现JBI但是却非常好用。
–ServiceMix架构–ServiceMix组件概览–ServiceMix实战–Demo–Mule的工作机理–Mule组件概览–Mule实战–Demo–削弱了部门间的协作–影响资源的整合Point-to-PointsolutionHub-and-...作为ASF的一员,它集成了包括...
浪曦JavaScript框架实战开发及应用 ExtJs 3.0 Oracle数据库,企业软件的基石 真实企业级CRM项目 另配套附送本项目其它高级部分,手把手教学视频在浪曦CRM教学中,比如: Mule Esb发布基于CXF,Axis的WebService,...
source enterprise integration frameworks like Mule, Camel, ServiceMix, and Spring Integration. My work, over time, drove me to designing and developing processes and BPM , and I started using j BPM ...
为实现在CANoe中开发刷新功能,读取刷新文件相对较为复杂...实战使用过程中,遇到了ASCII的S19,Hex格式。二进制的bin文件。以及组合格式的VBF格式。 分享读取这2种文件的方法。有不同格式的文件,修改起来也大同小异;