Skip to content
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

Retain functionality works inconsistently #109

Open
saraheem opened this issue Dec 12, 2024 · 3 comments
Open

Retain functionality works inconsistently #109

saraheem opened this issue Dec 12, 2024 · 3 comments

Comments

@saraheem
Copy link

saraheem commented Dec 12, 2024

Version: 3.3.3
Deployment Config: Windows 11, OpenJDK 21.0.5, Standalone mode, Default configuration
Tools: Using Mqtt-Stresser for pub/sub

A Steps:

  1. Connect 50 Clients, each client publishes 1 messages on 1 Topic (test\client-1, test\client-2, test-client-3....) with QOS 1, Retain true.

Behavior:
No message being retained.

B Steps:

  1. Delete Data\retain_data folder
  2. Start Stand alone server
  3. Connect 50 Clients, each client publishes 1 messages on 1 Topic (test\client-1, test\client-2, test-client-3....) with QOS 1, Retain true.

Behavior:
Only 10 topics are retained and the rest do not get retained

C Steps:

  1. Connect 50 Clients, each client publishes 1 messages on 1 Topic (test\client-1, test\client-2, test-client-3....) with QOS 0, Retain true.

Behavior:
It seems that only 10 messages every get retained, is this a configuration flag

@Gujiawei-Edinburgh
Copy link
Contributor

"It seems that only 10 messages every get retained, is this a configuration flag"
I think there is no such a limit for the retain storage. How do you find that the message is not retained, e.g by subscribing the topic? I think may be BifroMQ can add a listRetainMessage in api server.

@saraheem
Copy link
Author

saraheem commented Dec 13, 2024

@Gujiawei-Edinburgh, in the info log there was the following line: RetainMessageMatchLimit=10, is it possible that this has to do with the reported behavior? seems that this configuration sets the match limit for a retain message topic subscription match? where can we change this config from?

How do you find that the message is not retained, e.g by subscribing the topic? No, I am doing a wildcard subscription and i've figured that is the real issue. Bifromq will limit the retained topics matched if its a wildcard subscription based on the RetainMessageLimit config flag.

@Gujiawei-Edinburgh
Copy link
Contributor

@saraheem If your subscribed topic, i.e. topic filter, has wildcard, e.g. * or #, it will match multiple topics. If so, during matching process, if the number of matched topics exceeds the limit which is 10 by default, you cannot get all the retained messages. You can write your own setting provider to override the default settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants