dotnet / dotnet/MQTTnet

Help to analyze an issue due to slowness

Open
#2,165 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
5.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

### Describe your question
I would like to how analyze the following issue.

### Which project is your question related to?
- Client
- Server

### Environment
- Windows 11 IoT
- MQTTNet 5.0.1.1416
- MQTTnet.AspNetCore 5.0.1.1416

### Description of the scenario
1. A webapp sends a message to a subscriber. It takes less than 5 ms.
2. The message is... I don't know where 🤕 --> **This is my worry** and I don't know how to debug it.
3. When the message is delivered to the subscriber, it is processed and returned the response on 20 miliseconds or less.

*In this moment the message has taken about 6-9 seconds since the webapp sent it.*

4. After the verification process has finished, the user can use the webapp. From this moment on the sending and receiving the message takes less than 5 ms.

### Other tested solutions
1. I have used an alternative MQTT client and the time is the same.

### Some pieces of code

#### Subscriber

```csharp
private readonly IMqttClient clientToSubscribe = new MqttClientFactory().CreateMqttClient();

...

// Listening the topics...
clientToSubscribe.ApplicationMessageReceivedAsync += async eventArgs =>
{
MqttApplicationMessage message = eventArgs.ApplicationMessage;

switch (topic)
{
case "MY_TOPIC": {. .. }
default: break;
}
// ...
}

```

Thanks for advance.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.