问题描述
我想在具有静态主机的2节点群集上启用消息重新分发.但这似乎行不通.
I would like to enable message redistribution on my 2-nodes cluster with static hosts. But it does not seem to work.
1)我有10个生产者,它们写入节点1上的队列"MyTestQueue"(但没有消费者).
2)我在节点2上有1个使用者(但没有生产者),它使用了来自节点2的消息.
1) I have 10 producers that write to the queue "MyTestQueue" on node 1 (but no consumers).
2) I have 1 consumer on node 2 (but no producers) that consumes messages from node 2.
我希望节点1将消息重新分发到使用方存在的节点2,但事实并非如此.节点1上的邮件数仍然等于发送到节点1的邮件数.
I expect that node 1 will redistribute the messages to node 2 where the consumer exists, but it does not. The message count on node 1 is still equal the amount of messages that was sent to node 1.
我的broker.xml中具有以下配置,该配置将forward-when-no-consumers
设置为false.我还将redistribution-delay
设置为零.
I have the following configuration in my broker.xml that sets forward-when-no-consumers
to false.I also have set redistribution-delay
to a value of zero.
<jms xmlns="urn:activemq:jms">
<queue name="MyTestQueue"/>
</jms>
...
<cluster-connections>
<cluster-connection name="my-test-cluster">
<address>jms</address>
<connector-ref>server0-connector</connector-ref>
<retry-interval>500</retry-interval>
<use-duplicate-detection>true</use-duplicate-detection>
<forward-when-no-consumers>false</forward-when-no-consumers>
<message-load-balancing>ON_DEMAND</message-load-balancing>
<max-hops>1</max-hops>
<confirmation-window-size>1024</confirmation-window-size>
<static-connectors>
<connector-ref>server1-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>
...
<address-settings>
<address-setting match="#">
<redelivery-delay>5000</redelivery-delay>
<redelivery-delay-multiplier>3</redelivery-delay-multiplier>
<max-redelivery-delay>10000</max-redelivery-delay>
<max-delivery-attempts>10</max-delivery-attempts>
<max-size-bytes>104857600</max-size-bytes>
<page-size-bytes>10485760</page-size-bytes>
<address-full-policy>PAGE</address-full-policy>
<redistribution-delay>0</redistribution-delay>
</address-setting>
</address-settings>
如何使消息重新分配正常工作?
How can I get the message redistribution to work?
推荐答案
这可能与已知的问题.如果消息中不包含应用程序属性字段,则代理可能无法对消息进行负载平衡.
This might be related to a known issue. There is a situation on which the broker fails to load balance the messages if they don't contain the application properties field.
可以,请尝试一下吗?
这篇关于在ArtemisMQ 2.x上的消息重新分发不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!