Skip to content

Client isn't being notified if message is not delivered #802

@EdwardSkrobala

Description

@EdwardSkrobala

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions