Skip to content

jetlinks/reactor-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Reactor MQTT

reactor-netty + netty-mqtt-codec = reactor-mqtt

Server

// create server
DisposableServer server = MqttServer
.create()
.host("0.0.0.0")
.port(1883)
.handle(connection->{

connection
 .handlePublishing(message->...)
 .handleSubscribe(subscription->...)
 .handleUnsubscrie(topic-> ... )

return validate(connection).then(connection.accept())

})
.bindNow();

Client

// create client
MqttClientConnection conn = MqttClient
.create()
.host("127.0.0.1")
.port(1883)
// handle all publishing from server
.handlePublishing(pub->{
    
})
.connectNow();

// subscribe and handle
Disposable disp =  conn.subscribe("/topic",publishing->{  .... });

conn.publish(topic,qos);

About

reactor mqtt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published