dotnet/MQTTnet

MQTTClient Thread-safety: Publishing

fazho opened this issue · 4 comments

Describe your question

I am using MqttClient class (

public sealed class MqttClient : Disposable, IMqttClient
) to publish MQTT messages. The method I am calling is PublishAsync(). Right now my code can access the same MqttClient object from multiple threads. Is MqttClient or PublishAsync() thread safe?

Which project is your question related to?

  • Client

@chkr1011 for visibility. Thanks!

QoS Level: at least once

The client is not thread safe.

Deep-dive thread: #2078