mmuecke / rxmqttnet Goto Github PK
View Code? Open in Web Editor NEWA extension to the MQTTnet project, to transform the subscriptions into observables and to publish form a observalbe stream.
License: MIT License
A extension to the MQTTnet project, to transform the subscriptions into observables and to publish form a observalbe stream.
License: MIT License
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.
The ManagedClient throws a exception when the options are null. The exception is not handled properly.
System.InvalidOperationException
HResult=0x80131509
Message=call StartAsync before publishing messages
Source=MQTTnet.Extensions.ManagedClient
StackTrace:
at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.d__55.MoveNext()
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());
}
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.