-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stored message count not changing #3217
Comments
What type of clients are you using then? Also; you can check the stored messages with mosquitto_db_dump. |
I am using libmosquitto for publishing the messages and rumqttc for subscribing. I will try
right? Currently I am not using a persistence db |
I was more looking for the specifics, like clean session client id etc |
Here's the setup for the publishing client: void Setup() {
mosquitto_lib_init();
mosq_ = mosquitto_new(nullptr, true, nullptr);
mosquitto_loop_start(mosq_);
mosquitto_connect_async(mosq_, remote.c_str(), port, keepalive);
}
void SendMsg() {
mosquitto_publish(mosq_, nullptr, topic.c_str(), len, payload, 1, false);
}
For the subscribing client I use this: let mut mqttoptions = MqttOptions::new("client-id", "localhost", 1884);
mqttoptions.set_keep_alive(Duration::from_secs(60));
mqttoptions.set_clean_session(false);
...
client
.subscribe(topic, QoS::AtLeastOnce)
.await?;
I also tried qos 0 and 2. This resulted in the same outcome.
|
I wonder if the store count is only changing when the durable client is unavailable.
1: Start subscriber with clean session = false 4: 6: Start publisher 8: Repeat 4 and 5 Now there should be messages in store with one client. |
This changed the output of
But the topic |
Using persistence or not doesn't change anything for this value - it's the number of messages stored in memory. You would expect it to increase when retained messages are published to new topics, or when there are messages published to the broker that are yet to be delivered to a subscriber - exactly as has been discussed already. If there is a subscriber that is not keeping up, and hence messages are being dropped for that client, then you wouldn't expect the count to increase - however it doesn't look like you have changed the max queue length which is much bigger than 53 by default. The other point is that if you're using QoS 0 messages, then messages will only be stored very briefly. |
I would expect your subscriber to have messages queued for it (DB_CHUNK_CLIENT_MSG > 0) with the steps Daedaluz suggested. |
But I am right in trying to observe |
@edgale Yes you're right. By the way, is this a work thing? |
Ok. Thanks. |
In that case, you could try getting one of the free trials at cedalo.com - this gives you a preconfigured instance of mosquitto to use for two weeks. If there's something odd about your setup for some reason then this eliminates that factor. I'm part of cedalo, we also offer support for mosquitto and extra features for businesses - which is the version that's running on the trials. |
Hi there,
I am trying to use
$SYS/broker/store/messages/count
to get insight how a client performs under heavy load.While testing the client subscribed to a topic can not handle the message amount in time and the messages get droped;
While testing I subscribe to
$SYS/broker/store/messages/count
withmosquitto_sub
and there the value does not change and is always53
:Also this value does not get updated while I am testing or when nothing is running.
Am I doing something wrong? I thought this $SYS topic would show me how many messages are in queue (as per doc):
Config:
Thanks for your help.
The text was updated successfully, but these errors were encountered: