向具有两个节点的Cluster上部署的vm发送消息

时间:2014-05-08 16:01:00

标签: mule cluster-computing mule-cluster

根据mule文档使用 mule-ha-bundle-2.0 设置群集,但两个节点 < strong>两台不同的计算机连接在同一网络中,可以部署具有vm和logger的流程,如下所示。

<flow name="vmc-flow" doc:name="vmc-jc-flow">
    <vm:inbound-endpoint exchange-pattern="one-way"
        path="vmq1" doc:name="vmq1-listner" />
    <logger
        message="Request hit to server: #[server.host] at time: #[server.dateTime] from the flow: #[flow.name] with payload: #[payload] and message id : #[message.id.toString()]"
        level="INFO" doc:name="log-info" />
</flow>

现在我的问题是:如何将邮件推送到该特定虚拟机队列?

我使用了另一个(下面)mule应用程序,该应用程序再次部署在同一个集群上,但监听器'vmq1'

未消耗
<spring:beans>
    <context:property-placeholder location="test-cluster-app.properties" />
</spring:beans>

<flow name="test-vmc-invoke" doc:name="test-vmc-invoke">
    <http:inbound-endpoint exchange-pattern="request-response"
        host="${http.host}" port="${http.port}" doc:name="HTTP" path="${http.path}" />
    <expression-filter expression="#[payload !='favicon.ico']"
        doc:name="filter-favicon" />
    <set-payload value="#[string:from http]" doc:name="set-payload" />
    <logger
        message="sending message to vmq1 at time #[server.dateTime], flow #[flow.name]"
        level="INFO" doc:name="log-info" />
    <vm:outbound-endpoint exchange-pattern="one-way"
        path="vmq1" doc:name="vmq1-dispatcher">
    </vm:outbound-endpoint>
</flow>

注意:能够点击http并将消息推送到'vmq1'

请帮助我理解我哪里出错了。

2 个答案:

答案 0 :(得分:3)

来自用户指南:http://www.mulesoft.org/documentation/display/current/VM+Transport+Reference#VMTransportReference-Considerations

  

警告

     

Mule实例中的每个应用程序都有自己唯一的VM集   端点。因此,VM传输不能用于在它们之间进行通信   不同的骡子应用程序。

因此,您无法使用VM端点建立应用程序间通信。改为使用JMS端点。

答案 1 :(得分:2)

在这里,您可以找到有关如何在不同的Mule应用中使用Shared Resources的链接。

  

只能使用以下连接器和相关规格   目前指定为共享资源:   HTTP / HTTPS   VM   JMS   JMS缓存连接工厂   数据库   WMQ   JBoss事务管理器   Bitronix事务管理器

请注意,VM传输是一项企业功能。然而,其他类型也可能对您的情况有用,例如HTTP或JMS。