Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Publish order of retained messages for wildcard subscriptions

Hi!

In the following situation:

1. Retained messages have been published on topics matching xyz/#, e.g.
xyz, xyz/0, xyz/1, xyz/2
2. Client subscribes to xyz/#

In what order will the retained messages be published to the client? Is
the order guaranteed in any way?

>From my tests, it appears the messages on xyz/... are published in
original publish order, but the message on the top-level topic xyz is
always published last. Is that correct?

```
$ mosquitto_pub -t "test2" -r -m "test"
$ mosquitto_pub -t "test2/1" -r -m "test"
$ mosquitto_pub -t "test2/2" -r -m "test"
$ mosquitto_pub -t "test2/" -r -m "test"
$ mosquitto_pub -t "test2/0" -r -m "test"
$ mosquitto_sub -t "test2/#" -v
test2/1 test
test2/2 test
test2/ test
test2/0 test
test2 test
```

Thanks!



Back to the top