-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Summary
Our team faced up with issue on our production environment - after RabbitMQ maintance all queues were deleted and our client is still publishing messages without any error.
We've prepared a short Pub/Sub demo reproducing it (https://github.com/EdwardSkrobala/MqttIssue).
Publisher & Subscriber connect to broker via websockets, publisher sends message every 5 sec with Qos-1 level set.
We need publisher to be acknowledged if it publishes message that is not delivered to subscriber.
Environment:
- .NET Core 3.0
- RabbitMQ 3.7
- Plugin: Mqtt
- Client Lib: MQTTnet 3.0.8 (https://github.com/chkr1011/MQTTnet)
Steps to reproduce:
- Run
docker-compose -f docker-compose-brokers.yml up
from root folder - Run
dotnet run
from project folder (src/Test/) - Trigger management UI - http://localhost:15672/#/queues (username="test", pass="test")
- Delete Queue
mqtt-subscription-subscriberqos1
to simulate maintance on server.
Code lines showing issue
Message configuration
var message = new MqttApplicationMessageBuilder() .WithTopic("MyTopic") .WithPayload($"Hello World [{DateTime.Now.ToLongTimeString()}]") .WithQualityOfServiceLevel(MQTTnet.Protocol.MqttQualityOfServiceLevel.AtLeastOnce) .WithRetainFlag(false) .Build()
PublishAsync returns MqttClientPublishResult containing MqttClientPublishReasonCode (https://github.com/chkr1011/MQTTnet/blob/master/Source/MQTTnet/Client/Publishing/MqttClientPublishResult.cs)
var publishResult = await publisherClient.PublishAsync(message)
Expected result:
Exception or MqttClientPublishResult.ReasonCode = MqttClientPublishReasonCode.NoMatchingSubscribers
Actual result:
MqttClientPublishResult.ReasonCode = Success
Thanks in advance for the assistance