You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2019/08/30 19:08:00 UTC

[jira] [Comment Edited] (ARTEMIS-2455) Unexpected MQTT path separator conversion handling

    [ https://issues.apache.org/jira/browse/ARTEMIS-2455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16919632#comment-16919632 ] 

Justin Bertram edited comment on ARTEMIS-2455 at 8/30/19 7:07 PM:
------------------------------------------------------------------

I've investigated the impact of the wildcard-address configuration on multiple protocols handling.

I configured the broker as follow:
 - 2 acceptors (MQTT and AMQP)
 - MQTT configuration for {{<wildcard-addresses>}}
{code:xml}
<wildcard-addresses>
    <routing-enabled>true</routing-enabled>
    <delimiter>/</delimiter>
    <any-words>#</any-words>
    <single-word>+</single-word>
</wildcard-addresses>
{code}

Then I created 2 clients:
 * one AMQP (based on Qpid-proton library)
 * one MQTT (based on Paho library)

*Test 1*:
 * AMQP client subscribes address {{#}}
 * MQTT client published messages to topic {{topic1/topic2}}
 * AMQP client receives messages from address {{topic1/topic2}} (but expected result was {{topic1.topic2}})

So I tried a different subscription (using single word wildcard)
 *Test 2*:
 * AMQP client subscribes address {{.}} (AMQP protocol wildcards syntax)
 * MQTT client published messages to topic {{topic1/topic2}}
 * AMQP client doesn't receive any messages (but expected result was {{topic1.topic2}})

*Test 3*:
 * AMQP client subscribes address {{/}}
 * MQTT client published messages to topic {{topic1/topic2}}
 * AMQP client receives messages from address {{topic1/topic2}} (but expected result was {{topic1.topic2}})

So from my understanding, regardless which is the protocol specific wildcards, the broker configuration overrides it. Then the broker cannot handle correctly protocols with different wildcards.

Is it possible to configure the broker to met the correct behavior or there is no way to have multiple protocols, at the same time and with different wildcards, handled correctly by the broker?


was (Author: riccardo.modanese@eurotech.com):
I've investigated the impact of the wildcard-address configuration on multiple protocols handling.

I configured the broker as follow:
- 2 acceptors (MQTT and AMQP)
- wildcard-addresses (MQTT configuration)
     <wildcard-addresses>
         <routing-enabled>true</routing-enabled>
         <delimiter>/</delimiter>
         <any-words>#</any-words>
         <single-word>+</single-word>
     </wildcard-addresses>

Then I created 2 clients, one AMQP (based on Qpid-proton library) and one MQTT (based on Paho library)

Test 1:
 AMQP client subscribes address #
 MQTT client published messages to topic topic1/topic2
 AMQP client receives messages from address topic1/topic2 (but expected result was topic1.topic2)

So I tried a different subscription (using single word wildcard)
TEST 2:
 AMQP client subscribes address *.* (AMQP protocol wildcards syntax)
 MQTT client published messages to topic topic1/topic2
 AMQP client doesn't receive any messages (but expected result was topic1.topic2)

Test 3:
 AMQP client subscribes address +/+
 MQTT client published messages to topic topic1/topic2
 AMQP client receives messages from address topic1/topic2 (but expected result was topic1.topic2)

So from my understanding, regardless which is the protocol specific wildcards, the broker configuration overrides it.
Then the broker cannot handle correctly protocols with different wildcards.

Is it possible to configure the broker to met the correct behavior or there is no way to have multiple protocols, at the same time and with different wildcards, handled correctly by the broker?

> Unexpected MQTT path separator conversion handling
> --------------------------------------------------
>
>                 Key: ARTEMIS-2455
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2455
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: MQTT
>    Affects Versions: 2.9.0
>            Reporter: Riccardo Modanese
>            Priority: Minor
>         Attachments: MqttTopicIT.java
>
>
> Hello, I noticed an unexpected MQTT path separator conversion handling. (May be I'm missing some configuration parameter in the acceptor definition?)
> The char '.' on a MQTT topic is handled by Artemis as a topic separator instead of a "normal" topic character. So an MQTT topic like 'a.b.c.d' becames 'a/b/c/d'.
> I attach a Junit test I developed for testing different topics.
> I used Artemis 2.9.0. The acceptor configuration is:
> {{tcp://0.0.0.0:1883?tcpSendBufferSize=1048576&tcpReceiveBufferSize=1048576&protocols=MQTT&allowLinkStealing=true&useEpoll=true}}
>  
> Regards,
> Riccardo



--
This message was sent by Atlassian Jira
(v8.3.2#803003)