Skip to content

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

@relufi

Description

@relufi

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions