在Mule中采用JMS 传输器进行消息传输,首先要有消息总线的支持,以ActiveMQ为例,详细步骤如下:
1 启动ActiveMQ(详见ActiveMQ)
2 编写发送端配置文件
jms-send-mule-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
xmlns:http="http://www.mulesource.org/schema/mule/http/2.2"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
xmlns:https="http://www.mulesource.org/schema/mule/https/2.2"
xsi:schemaLocation="
http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd
http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd
http://www.mulesource.org/schema/mule/https/2.2 http://www.mulesource.org/schema/mule/https/2.2/mule-https.xsd
http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd">
<jms:activemq-connector name="jmsQueueConnector" specification="1.0.2b" brokerURL="tcp://localhost:61616"/>
<jms:activemq-connector name="jmsTopicConnector" specification="1.0.2b" brokerURL="tcp://localhost:61616"/>
<stdio:connector name="stdioConnector"
messageDelayTime="1234"
promptMessage="Please enter something: "
/>
<model name="jms102bModel">
<service name="jms102bService">
<inbound>
<stdio:inbound-endpoint system="IN"/>
</inbound>
<outbound>
<pass-through-router>
<jms:outbound-endpoint connector-ref="jmsTopicConnector" topic="backup-reports"/>
</pass-through-router>
</outbound>
</service>
</model>
</mule>
3 编写接收端配置文件
jms-receive-mule-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2"
xsi:schemaLocation="
http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd">
<jms:activemq-connector
name="jmsConnector"
specification="1.0.2b"
brokerURL="tcp://localhost:61616"/>
<model name="Listing 3.19">
<service name="Backup Reporting Service">
<inbound>
<jms:inbound-endpoint topic="backup-reports" connector-ref="jmsConnector">
<jms:jmsmessage-to-object-transformer/>
</jms:inbound-endpoint>
</inbound>
<outbound>
<pass-through-router>
<stdio:outbound-endpoint system="OUT"/>
</pass-through-router>
</outbound>
</service>
</model>
</mule>
4 分别启动receive和send,发送端输入信息,接收端将会将输入的信息显示到控制台上。
over
分享到:
相关推荐
datatree.zip,Java的XML库使用Java生成XML文档和模式的简单方法,但感觉像clojure
mule esb连接rabbitmq需要的jar,另外还需要amqp-client这个jar
这是一个使用Netty( )的Mule传输实现,它支持在原始TCP上进行发布/订阅(从较高的角度看,它类似于JMS主题,但是功能有限,例如,不支持事务处理) ,并且没有外部经纪人)。 由Ricston Ltd( )开发。 要从源...
在 Dockerised Mule CE 服务器上运行的 Mule 应用程序示例 这是的配套项目博客文章。 构建图像 # docker build --tag sample-app . 运行容器 # docker run -it -p 8080:9000 -v /data/mule-app:/opt/mule/logs -e...
Mule ESB 容易集成现有异构系统,包括:JMS, Web Services, JDBC, HTTP, 等. ESB的关键特性是允许不同的应用通讯,其作为运输系统在企业内或Internet应用间搬运数据。 Mule ESB 包含如下强大的能力: 服务创建和...
mule_spring_hibernate_demo Spring和Hibernate的Mule持久性示例
Mule Webapp 示例此示例演示如何将 Mule 应用程序包装为 JavaEE Web 应用程序 (WAR)。 它的存在是为了解决以下常见问题: 使用 HTTP 而不是 Servlet 入站端点,这可行但没有意义,因为它绕过了 web 容器的 web 层并...
一份关于Mule和其他Jms消息系统关联的开发文档,涉及系统的集成搭建
mule in action 和doc文档详细介绍 Mule的核心组件是UMO(Universal Message Objects,从Mule2.0开始UMO这一概念已经被组件Componse所代替),UMO实现整合逻辑。UMO可以是POJO,JavaBean等等。它支持30多种传输协议...
Mule技术开始手册英文版Mule技术开始手册英文版
描述如何通过Mule实现Webservice的发布、实现JMS消息通信、ftp、File应用、协议转换等
Mule是一个企业服务总线(ESB)消息框架,而且Mule是一个轻量级且高度可扩展的ESB。
Mule是一个以Java为核心的轻量级的消息框架和整合平台,基于EIP(Enterprise Integeration Patterns,由Hohpe和Woolf编写的一本书)而实现的。Mule的核心组件是UMO(Universal Message Objects,从Mule2.0开始UMO这一...
mule配置常用节点解释,示例模型,基本标签
mule -esb 源码
Mule 是一个基于ESB架构理念的消息平台。Mule 的核心是一个基于SEDA的服务容器,该容器管理被称为通用消息对象(Universal Message Objects /UMO)的服务对象,而这些对象都是POJO。所有UMO和其他应用之间的通信都是...