eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker

Home Page:https://mosquitto.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Number of retained messages inconsistent

overlinden opened this issue · comments

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

$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 $

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