代码之家  ›  专栏  ›  技术社区  ›  Mohamed Hosni

活动mq artemis springboot群集主题负载平衡(循环)问题

  •  0
  • Mohamed Hosni  · 技术社区  · 7 年前

    在花费大量时间配置和尝试大量解决方案以使Artemis在 模式,如 地方的 a中的模式 发布订阅 (主题)。 所以我准备了3个 消费者 在不同的 节点 和a 制作人 仅在一个节点上发布消息。 我预计这3位消费者会收到他们自己的消息副本,如中所述 here !

    问题是集群(核心网桥)仍然在3个节点之间循环消息。


    我的项目Github Repo

    spring-boot-artemis-clustered-topic


    代理群集配置

    <!-- Using STRICT is like setting the legacy forward-when-no-consumers 
    parameter to true--> 
    <!-- Using ON_DEMAND is like setting the legacy forward-when-no-consumers 
    parameter to false.-->
    <cluster-connections>
         <cluster-connection name="my-cluster">
         <address>jms</address>
            <connector-ref>netty-connector</connector-ref>
            <retry-interval>500</retry-interval>
            <use-duplicate-detection>true</use-duplicate-detection>
            <message-load-balancing>ON_DEMAND</message-load-balancing>
            <max-hops>1</max-hops>
            <discovery-group-ref discovery-group-name="my-discovery-group"/>
         </cluster-connection>
    
    </cluster-connections>
    

    消费者行为 artemis-b1-b2-b3

    1 回复  |  直到 7 年前
        1
  •  0
  •   Ashok Kallara    7 年前

    在您的 ConnectionFactoryClusteredConfig.pubSubFactory() 方法,尝试移动 factory.setPubSubDomain(true) 之后 configurer.configure(factory, connectionFactory) 如下所述: https://stackoverflow.com/a/44416121/832268 .