集群模式下的JBoss EAP7.1集成ActiveMQ Artemis消息重新分发不起作用

时间:2019-05-15 20:07:18

标签: jboss activemq-artemis

遵循https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuring_messaging/clusters_overview的项目29之后,重新分配测试将不起作用。

测试用例:1个jboss主服务器和2个jboss从属服务器。我在artemis中创建了“ respostaCsu”队列,并在其上发布了一条消息。消息到达slave-1。该服务器的关联ID没有关联的侦听器,因此没有从队列中删除该消息。消息应根据RedHat(重新分配延迟= 0且消息负载平衡类型= ON_DEMAND)文档转发到下一个群集计算机(从站2)。但是,该消息未重定向,并保留在slave-1中。

有什么建议吗?

JBoss EAP 7.1主domain.xml文件:

...
<socket-binding-group name="full-ha-sockets" default-interface="public">
    <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
    <socket-binding name="http" port="${jboss.http.port:8080}"/>
    <socket-binding name="https" port="${jboss.https.port:8443}"/>
    <socket-binding name="iiop" interface="unsecure" port="3528"/>
    <socket-binding name="iiop-ssl" interface="unsecure" port="3529"/>
    <socket-binding name="jgroups-mping" interface="private" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
    <socket-binding name="jgroups-tcp" interface="private" port="7600"/>
    <socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
    <socket-binding name="modcluster" port="0" multicast-address="${jboss.modcluster.multicast.address:224.0.1.105}" multicast-port="23364"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <socket-binding name="messaging-group" interface="private" port="5432" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="9876"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

...
<subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
    <server name="default">
        <security enabled="false"/>
        <cluster user="mbuser" password="mbsenha"/>
        <security-setting name="#">
            <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
        </security-setting>
        <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10" redistribution-delay="0"/>
        <address-setting name="jms.#" redistribution-delay="0"/>
        <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
        <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
            <param name="batch-delay" value="50"/>
        </http-connector>
        <in-vm-connector name="in-vm" server-id="0">
            <param name="buffer-pooling" value="false"/>
        </in-vm-connector>
        <http-acceptor name="http-acceptor" http-listener="default"/>
        <http-acceptor name="http-acceptor-throughput" http-listener="default">
            <param name="batch-delay" value="50"/>
            <param name="direct-deliver" value="false"/>
        </http-acceptor>
        <in-vm-acceptor name="in-vm" server-id="0">
            <param name="buffer-pooling" value="false"/>
        </in-vm-acceptor>
        <broadcast-group name="mb-broadcast-group" socket-binding="messaging-group" broadcast-period="2000" connectors="http-connector"/>
        <discovery-group name="mb-discovery-group" socket-binding="messaging-group" refresh-timeout="10000"/>
        <cluster-connection name="my-cluster" address="jms" connector-name="http-connector" use-duplicate-detection="false" message-load-balancing-type="ON_DEMAND" discovery-group="mb-discovery-group"/>
        <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
        <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
        <jms-queue name="solicitacaoCsu" entries="java:/jms/queue/QL.REQ.BKLQ001Z" durable="false"/>
        <jms-queue name="respostaCsu" entries="java:/jms/queue/QL.RSP.BKLQ001Z" durable="false"/>
        <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
        <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector" ha="true" block-on-acknowledge="true" reconnect-attempts="-1"/>
        <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
    </server>
</subsystem>

2 个答案:

答案 0 :(得分:0)

重新分发不支持选择器。但是,初始分配确实可以。因此,您应该在发送请求之前 创建使用者,以便在发送回复时该使用者位于队列中。

答案 1 :(得分:0)

谢谢大家。 但是我找到了解决方案!问题是套接字绑定中的“ messaging-group”标签!我配置了port = 0,将multicast-addres配置为231.7.7.7,并将redistribution-delay配置为0。 =)

这是我的Jboss CLI:

/profile=full-ha/subsystem=messaging-activemq/server=default/broadcast-group=bg-group1:remove
/profile=full-ha/subsystem=messaging-activemq/server=default/discovery-group=dg-group1:remove
/socket-binding-group=full-ha-sockets/socket-binding=messaging-group:add(port=0,multicast-address=${jboss.messaging.group.address:231.7.7.7},multicast-port=${jboss.messaging.group.port:9876})
/socket-binding-group=full-ha-sockets/socket-binding=messaging-throughput:add(port=5455)

/profile=full-ha/subsystem=messaging-activemq/server=default/broadcast-group=bg-group1:add(socket-binding=messaging-group,broadcast-period=5000,connectors=[http-connector])
/profile=full-ha/subsystem=messaging-activemq/server=default/discovery-group=dg-group1:add(socket-binding=messaging-group,refresh-timeout=10000)
/profile=full-ha/subsystem=messaging-activemq/server=default/address-setting=#:write-attribute(name=redistribution-delay,value=0)