Skip to content

A Reactive MQTTnet Client and other Industrial protocols to use with the client. ManagedClient, TwinCat, ABPlc, Modbus, SerialPort, S7Plc

License

Notifications You must be signed in to change notification settings

ChrisPulman/MQTTnet.Rx

Repository files navigation

License Build

MQTTnet.Rx.ManagedClient

Nuget NuGet

MQTTnet.Rx.ABPlc

Nuget NuGet

MQTTnet.Rx.Modbus

Nuget NuGet

MQTTnet.Rx.S7Plc

Nuget NuGet

MQTTnet.Rx.SerialPort

Nuget NuGet

MQTTnet.Rx.TwinCAT

Nuget NuGet

Alt

MQTTnet.Rx

MQTTnet.Rx.ManagedClient

A Reactive Managed Client for MQTTnet Broker

Create a Mqtt Client to Publish an Observable stream

Create.MqttClient()
    .WithClientOptions(a => a.WithTcpServer("localhost", 9000))
    .PublishMessage(_message)
    .Subscribe(r => Console.WriteLine($"{r.ReasonCode} [{r.PacketIdentifier}]"));

Create a Managed Mqtt Client to Publish an Observable stream

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 a Mqtt Client to Subscribe to a Topic

Create.MqttClient()
    .WithClientOptions(a => a.WithTcpServer("localhost", 9000))
    .SubscribeToTopic("FromMilliseconds")
    .Subscribe(r => Console.WriteLine($"{r.ReasonCode} [{r.ApplicationMessage.Topic}] value : {r.ApplicationMessage.ConvertPayloadToString()}"));

Create a Managed Mqtt Client to Subscribe to a Topic

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()}"));