MQTTnet
MQTTnet copied to clipboard
Decouple connection middleware from MQTTnet.AspnetCore
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.
@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.
More information here https://github.com/davidfowl/BedrockTransports
@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.
@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()
That’ll be a separate assembly.
@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 Could you please have a look if here is something to do?