You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Zhang Xiang (Jira)" <ji...@apache.org> on 2021/04/23 04:56:00 UTC

[jira] [Created] (ARTEMIS-3262) Cannot get max-hops >= 2 federation to work

Zhang Xiang created ARTEMIS-3262:
------------------------------------

             Summary: Cannot get max-hops >= 2 federation to work
                 Key: ARTEMIS-3262
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3262
             Project: ActiveMQ Artemis
          Issue Type: Bug
          Components: Federation
    Affects Versions: 2.17.0
         Environment: Artemis 2.17.0 on 3 Linux machines

Dragonwell OpenJDK 11
            Reporter: Zhang Xiang


I want to construct a 3-level MQTT message forwarding system:

A → B → C

Once a message publish under the topic "from-A" to A, all clients subscribing "from-A" on B and C should receive that message.

Here is the config of B:

 
{code:java}
<connectors>
    <connector name="connector-A">tcp://192.168.1.200:61616</connector>
</connectors>

<federations>
    <federation name="federation-B">

        <upstream name="upstream-from-A">
            <share-connection>true</share-connection>
            <static-connectors>
                <connector-ref>connector-A</connector-ref>
            </static-connectors>
            <policy ref="policy-from-A"/>
        </upstream>

        <address-policy name="policy-from-A" max-hops="2">
            <include address-match="from-A" />
        </address-policy>
        
    </federation>
</federations>

<addresses>
    <address name="from-A">
        <multicast>
            <queue name="from-A-subscription"/>
        </multicast>
</address>
{code}
And here is the config of C:

 

 
{code:java}
<connectors>
    <connector name="connector-B">tcp://192.168.1.100:61616</connector>
</connectors>
<federations>
    <federation name="federation-C">

        <upstream name="upstream-from-C">
            <static-connectors>
                <connector-ref>connector-C</connector-ref>
            </static-connectors>
            <policy ref="policy-from-A"/>
        </upstream>

        <address-policy name="policy-from-A" max-hops="1">
            <include address-match="from-A" />
        </address-policy>
    </federation>
</federations>

<addresses>
    <address name="from-A">
        <multicast>
            <queue name="from-A-subscription"/>
        </multicast>
    </address>
</addresses>
{code}
The problem is that the message cannot be forwarded for more than 1 time.

 
 * If I published a "from-A" message to B, all clients subscribing "from-A" on C could receive the message.
 * If I published a "from-A" message to A, all clients subscribing "from-A" on B could receive the message, but clients on C wouldn't!

The example config files provided by the software packages do not cover this kind of situations, nor do the documentation.

Please tell me if it is a bug and if not, what should I do.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)