Skip to content

rumqttc: TopicNotUtf8 error causes disconnection when subscribing to system topics #958

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

Open
relufi opened this issue Mar 31, 2025 · 0 comments

Comments

@relufi
Copy link

relufi commented Mar 31, 2025

I encountered an issue when using rumqttc to subscribe to the system topic "$SYS/brokers/+/clients/+/connected"(my mqtt server is emqx), which is used to monitor client connection events. Some clients have non-UTF-8 encoded IDs, and when such a client connects, rumqttc throws a TopicNotUtf8 error. This causes rumqttc to disconnect and reconnect automatically.

The frequent disconnections lead to unstable connections and message loss in my application. I believe that instead of disconnecting upon encountering a TopicNotUtf8 error, rumqttc should either:

Ignore the invalid topic and continue running normally.

Handle the error in a way that does not cause a reconnection.

Would it be possible to improve the error handling in this scenario? Thank you!

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

1 participant