eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.93k stars 2.37k forks source link

Number of retained messages inconsistent #3030

Open overlinden opened 5 months ago

overlinden commented 5 months ago

Hi community,

I found a strange behavior of the broker.

The number of retained messages reported via $SYS/broker/retained messages/count does not match the number of messages returned by mosquitto_sub -t "#" -v --retained-only

In my example the $sys topic reports 101 retained messages but the mosquitto_sub command returns 50 only.

Can you explain why? Which number is correct?

Best regards Oliver

ckrey commented 3 months ago

$SYS/broker/retained messages/count includes all retained messages including the messages on system topics (e.g. $SYS/#)

mosquitto_sub -t "#" -v --retained-only receives only messages retained on "user" topics (not starting with $

overlinden commented 2 months ago

@ckrey Thank you for the clarification. Is there any metric available to get the number of retained user-topic messages only?