MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

Decouple connection middleware from MQTTnet.AspnetCore

Open davidfowl opened this issue 4 years ago • 7 comments

Describe the feature request

As part of .NET Core 3.0, we've exposed some client /server networking abstractions (see https://github.com/aspnet/AspNetCore/issues/10308) that were made to serve as a foundation for projects like this build on top of. The MQTT layer should support a very thin way to wire up the MqttConnectionHandler with a way to write logic to handle messages (decoupled from the underlying transport).

MQTTnet.AspnetCore should expose the web specific wire up.

davidfowl avatar Sep 18 '19 05:09 davidfowl

@JanEggers This is something that might be worth a look when you do https://github.com/chkr1011/MQTTnet/issues/464 once 3.0 is released.

SeppPenner avatar Sep 18 '19 06:09 SeppPenner

More information here https://github.com/davidfowl/BedrockTransports

davidfowl avatar Sep 18 '19 06:09 davidfowl

@davidfowl thx for pointing it out. I will have a look once 3.0 is out.

are there any official packages besides kestrel that implement these abstractions?

like a tls middleware, a tcp server or a tcp client because that are the parts that are lacking today.

without these implementations I see no reason not to depend on kestrel directly.

JanEggers avatar Sep 18 '19 13:09 JanEggers

@davidfowl also setup looks a bit hacky. you should really rewrite that stuff to depend on service collection and maybe generic host.

so you can:

new HostBuilder() .AddConnections() .AddTcp() or AddWebSocket() or AddKestrel() or AddTransportXXXX .AddTls() .AddMqtt() .Build() .RunAsync()

JanEggers avatar Sep 18 '19 13:09 JanEggers

That’ll be a separate assembly.

davidfowl avatar Sep 18 '19 14:09 davidfowl

@davidfowl im happy to adopt just let me know when there are shipped bits / things I can use without installing a preview version of vs / sdk

JanEggers avatar Sep 18 '19 15:09 JanEggers

@JanEggers Could you please have a look if here is something to do?

chkr1011 avatar Jul 13 '22 13:07 chkr1011