Cluster computing HornetQ群集节点消费者

Cluster computing HornetQ群集节点消费者,cluster-computing,mule,hornetq,Cluster Computing,Mule,Hornetq,我有一个带有2个节点的HornetQ独立集群,Mule ESB配置为连接HornetQ集群发现组 我编写了一个Mule回调监听器,它使用来自HornetQ集群的消息。但集群中的第二个节点的行为类似于备份或故障转移服务器。当我发送多条消息时,它总是只发送给节点1。当我停止node1时,node2正在拾取消息。对于节点2,JConsole始终将使用者的数量显示为0。而node1有6个消费者,如Mule JMS connector->numberOfConsumers属性中定义的,如下面的配置所示 &

我有一个带有2个节点的HornetQ独立集群,Mule ESB配置为连接HornetQ集群发现组

我编写了一个Mule回调监听器,它使用来自HornetQ集群的消息。但集群中的第二个节点的行为类似于备份或故障转移服务器。当我发送多条消息时,它总是只发送给节点1。当我停止node1时,node2正在拾取消息。对于节点2,JConsole始终将使用者的数量显示为0。而node1有6个消费者,如Mule JMS connector->numberOfConsumers属性中定义的,如下面的配置所示

<jms:connector name="hornetq-connector" username="guest" 
    maxRedelivery="5" password="guest" specification="1.1"
    connectionFactory-ref="connectionFactory" numberOfConsumers="6" >
    <spring:property name="retryPolicyTemplate" ref="ThreadingPolicyTemplate"  />
</jms:connector>
}


如何在所有HornetQ群集节点上分配这一消费者?

您所说的“Mule回调侦听器”是什么?JMS传输的特定扩展?你能展示它的代码吗?我可以通过指定所有消息源,使用Mule的复合源标记来解决这个问题。如果您需要更多信息,请告诉我。
<flow name="Flow2" doc:name="Flow2">
    <jms:inbound-endpoint queue="InboundQueue"
     connector-ref="hornetq-connector">
        <jms:transaction action="ALWAYS_BEGIN" timeout="10000" />
    </jms:inbound-endpoint>

    <component class="com.test.Consumer" />
</flow>
private static DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

@Override
public Object onCall(MuleEventContext eventContext) throws Exception {
    // TODO Auto-generated method stub

    System.out.println(df1.format(new Date().getTime())+"Consumer:Message Received,"+ Thread.currentThread()+ "," + eventContext.getMessageAsString());
    Thread.sleep(5000);
    System.out.println(df1.format(new Date().getTime())+"Consumer: Message process complete, "+ Thread.currentThread()+ ","  + eventContext.getMessageAsString());

    return "Success";
}