GithubHelp home page GithubHelp logo

mmuecke / rxmqttnet Goto Github PK

View Code? Open in Web Editor NEW
29.0 4.0 6.0 304 KB

A extension to the MQTTnet project, to transform the subscriptions into observables and to publish form a observalbe stream.

License: MIT License

C# 100.00%
csharp rx mqtt-client iot comunication nuget netcore net mqtt-protocol

rxmqttnet's Issues

Subscribing to "test/+" does not receive any message

Describe the bug
Subscribing to "test/+" does not receive any message, but when I subscribe to "test/2" and publish to "test/2" I receive two messages.

To Reproduce

var options = new ManagedMqttClientOptionsBuilder()
            .WithAutoReconnectDelay(TimeSpan.FromSeconds(5))
            .WithClientOptions(new MqttClientOptionsBuilder()
                .WithClientId("ApiServer")
                .WithTcpServer("127.0.0.1")
                .WithProtocolVersion(MQTTnet.Formatter.MqttProtocolVersion.V500)
                .Build())
            .Build();

var _mqttClient = new MqttFactory().CreateRxMqttClient();
await _mqttClient.StartAsync(options).ConfigureAwait(false);
_mqttClient.ConnectedEvent.Subscribe(_ => Console.WriteLine("Client connected"));
_mqttClient.Connect($"test/+")
    .SelectMessage()
    .Subscribe(m =>
    {
        Console.WriteLine($"\tTopic {m.Topic}");
        Console.WriteLine(m.ConvertPayloadToString());
    }
    );

_mqttClient.Connect($"test/2")
    .SelectMessage()
    .Subscribe(m =>
    {
        Console.WriteLine("\tTopic test/2");
        Console.WriteLine(m.ConvertPayloadToString());
    }
    );

Connection to a global wildcard "#" returns no messages

Describe the bug
Connection to a global wildcard "#" client.Connect("#") returns no messages.
To Reproduce
Set up console app with this code.

var client = new MqttFactory().CreateRxMqttClient();
var options = new ManagedMqttClientOptionsBuilder()
  .WithAutoReconnectDelay(TimeSpan.FromSeconds(5))
  .WithClientOptions(new MqttClientOptionsBuilder()
    .WithClientId("Client1")
    .WithTcpServer("localhost")
    .Build())
  .Build();
await client.StartAsync(options).ConfigureAwait(false);
client.Connect("#").SelectPayload().Subscribe(Console.WriteLine);
await Task.Delay(-1).ConfigureAwait(false);

Expected behavior
Connection to a global wildcard "#" client.Connect("#") return all messages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.