> Is it possible to set the Artemis property _AMQ_DUPL_ID in a MQTT client?

Technically speaking, it is possible to set the property _AMQ_DUPL_ID in a
MQTT client. However, as you note, that property won't be treated the same
as in other protocol implementations.

> It seems to me that MQTT v5 User Properties keys in published messages are
> getting the prefix 'mqtt.ordered.user.property.' before being forwarded.

That's correct. This prefix serves 2 purposes when converting the MQTT
message to a Core message which are required by the MQTT 5 specification:

  1) A message can have multiple properties with the same name.
  2) The original order of message properties must be preserved.

> I also get the impression that the other protocols such as OpenWire and
AMQP are handled differently.

Every protocol has different nuances in how it handles messages based on
expected semantics for that protocol.

> The AMQ_DUPL_ID property seems to be set automatically when the Artemis
> broker receives a message.

To my knowledge, this isn't done for AMQP. This is done for OpenWire when
dealing with connections using a "failover://" URL. See the code [1] for
more details on that.

> Why is the processing of MQTT different?

There are two main reasons that the MQTT implementation is different with
regard to how it handles message properties:

  1) The MQTT specification didn't even support message properties until 5.
  2) The MQTT specification already has a way to deal with duplicates using
its quality-of-service levels.

Is there a use-case where using _AMQ_DUPL_ID would be preferred over using,
for example, QoS 2?


Justin

[1]
https://github.com/apache/activemq-artemis/blob/25fd8e90587d8b931040dfead5dfa5077d118599/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java#L392



On Tue, Jun 10, 2025 at 5:41 AM Devriendt, Erik
<erik.devrie...@siemens.com.invalid> wrote:

> Is it possible to set the Artemis property _AMQ_DUPL_ID in a MQTT client?
> It seems to me that MQTT v5 User Properties keys in published messages are
> getting the prefix 'mqtt.ordered.user.property.' before being forwarded.
>
> I also get the impression that the other protocols such as OpenWire and
> AMQP are handled differently. The AMQ_DUPL_ID property seems to be set
> automatically when the Artemis broker receives a message.
> Why is the processing of MQTT different?
>
> How can I set the _AMQ_DUPL_ID for MQTT messages?
>
> We would like to set up a federation of several Artemis brokers, with
> redundant connections between them (they are all on multihomed machines).
> The aim is to have no logical connection downtime when one of the networks
> fails.
>
> All suggestions pointing to alternative solutions are welcome!
>
> Kind regards
> Erik Devriendt
>

Reply via email to