A Reactive Managed Client for MQTTnet Broker
Create.MqttClient()
.WithClientOptions(a => a.WithTcpServer("localhost", 9000))
.PublishMessage(_message)
.Subscribe(r => Console.WriteLine($"{r.ReasonCode} [{r.PacketIdentifier}]"));
Create.ManagedMqttClient()
.WithManagedClientOptions(a =>
a.WithAutoReconnectDelay(TimeSpan.FromSeconds(5))
.WithClientOptions(c =>
c.WithTcpServer("localhost", 9000)))
.SubscribeToTopic("FromMilliseconds")
.Subscribe(r => Console.WriteLine($"{r.ReasonCode} [{r.ApplicationMessage.Topic}] value : {r.ApplicationMessage.ConvertPayloadToString()}"));
Create.MqttClient()
.WithClientOptions(a => a.WithTcpServer("localhost", 9000))
.SubscribeToTopic("FromMilliseconds")
.Subscribe(r => Console.WriteLine($"{r.ReasonCode} [{r.ApplicationMessage.Topic}] value : {r.ApplicationMessage.ConvertPayloadToString()}"));
Create.ManagedMqttClient()
.WithManagedClientOptions(a =>
a.WithAutoReconnectDelay(TimeSpan.FromSeconds(5))
.WithClientOptions(c =>
c.WithTcpServer("localhost", 9000)))
.SubscribeToTopic("FromMilliseconds")
.Subscribe(r => Console.WriteLine($"{r.ReasonCode} [{r.ApplicationMessage.Topic}] value : {r.ApplicationMessage.ConvertPayloadToString()}"));