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

Gary Tully commented on ARTEMIS-2888:
-------------------------------------

paging is at the root of this problem. The destination header is populated from 
the address and the address field in a message is modified on write to paging. 
Paging is being initiated by the subscription queues with the subscribe to 
address, hense the wrong destination coming from the page store name.

A quick mod to not modify the address is the simplest solution, however I guess 
this will break something else, hopefully the full test suite will uncover.
As it stands, If in understand this correctly, there are multiple copies of 
messages in page-files for each subscription but it seems to hang together.

An better approach, to use less resources wold be to allow an address setting 
to specify a pagingAddress (or page store name) that could be shared by address 
hierarchies.

{code}
<address-settings>
   <address-setting match="A.#">
   <page-store-name>A.shared</page-store-name>
</address-settings>
{code}

In this way, subscribe to A.* and publish to A.a would use the same page store 
named A.shared. In the absence of a non null page-store-name, the address will 
be used as the store name as is the current default.
The downside to this sort of sharing will be the paging penalty is one consumer 
is slow, in a similar way as selectors can fragment an address.
However for high volume addresses, where there are many consumers, avoiding 
multiple copies of messages when paging will be preferable.

With this page store alias capability, the message address will still need to 
be left intact, unless we find a better way to populate the destination header. 

any better suggestion for <page-store-name> ?


> MQTT spec violation when subscribed to wildcard topic
> -----------------------------------------------------
>
>                 Key: ARTEMIS-2888
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2888
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: MQTT
>    Affects Versions: 2.14.0
>         Environment: *Message Producer:*
> MQTTnet Client
> published Message to  
> 0e5ed50e-ccea-4a42-8c3e-db0e2780222b/from-smart-acquisition-device/machine-state/event/off
>  
> *Message Consumer:*
> MQTT Paho Java Client, also tested with HiveMQ Java Client.
> Subscribed to +/from-smart-acquisition-device/machine-state/event/off
>            Reporter: Florian Meister
>            Assignee: Gary Tully
>            Priority: Major
>         Attachments: image-2020-08-27-12-37-01-479.png
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Sometimes the topic name of published messages contains the topic filter 
> instead of the topic name.
> This is neither correct nor allowed in the MQTT 3.1.1 specification:
> [http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718106]
>  
> Below a screenshot of an example MQTT Packet sent from the Artemis Broker
> !image-2020-08-27-12-37-01-479.png!
>  



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

Reply via email to