MULE下openjms挂载
上一篇 /
下一篇 2008-01-29 23:11:15
/ 个人分类:SOA
1. 资源
openjms
mule1.4.3
2.openjms服务器准备
openjms配置和启动
修改系统环境参数或(openjms.bat)中设置openjms根目录;
运行openjms服务端:
openjms run
运行openjms管理端
openjms admin
mule下openjms的connector配置
3. mule下openjms连接配置
<connector name="openjms" className="org.mule.providers.jms.JmsConnector">
<properties>
<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://192.168.2.23:3035"/>
</properties>
</connector>
4.服务配置:
<mule-configuration id="OPENJMSDEMO" version="1.0">
<description>
OPENJMSDEMO_HIAIHUA
</description>
<transformers>
<transformer name="msgToString"
className="org.mule.providers.jms.transformers.JMSMessageToObject"
returnClass="java.lang.String" />
</transformers>
<model name="openJMS">
<mule-descriptor name="jmsService" implementation="org.mule.components.simple.EchoComponent">
<inbound-router>
<!--endpoint address="jms://queue1"/-->
<endpoint address="jms://queue1" transformers="msgToString" connector-ref="openjms"/>
</inbound-router>
</mule-descriptor>
</model>
</mule-configuration>
5.连接测试
建立testjms.jsp文件,加入如下代码段:
try {
MuleClient client = new MuleClient();
String encodedFileString = "1";
UMOMessage message = client.send("jms://queue1", encodedFileString, null);
out.print(message.getPayload());
} catch(Exception e) {
}
6. 在openjms的管理端查看消息情况
在本例,消息是发送到queue1队列,所以我们可以看到一下图片
导入论坛
引用链接
收藏
分享给好友
推荐到圈子
管理
举报
TAG: