zarusz / SlimMessageBus

Lightweight message bus interface for .NET (pub/sub and request-response) with transport plugins for popular message brokers.
Apache License 2.0
467 stars 78 forks source link

[Host.Nats] Transport for Nats.io #286

Closed damien-blanchet closed 1 month ago

damien-blanchet commented 1 month ago

Hello,

I would like to propose the support of Nats.io.

I looked into using MQTT, which is already supported by SlimMessageBus and Nats, but Nats only supports MQTT 3.1 at the moment and this prevents the use of the Request-Reply functionality which depends on the headers available in MQTT 5.

https://nats.io/ https://github.com/nats-io/nats.net/tree/main

zarusz commented 1 month ago

Hi @damien-blanchet ,

I never heard of Nats, but it looks fresh and modern.

Are you looking to contribute a new transport called SlimMessageBus.Host.Nats or are you asking if maintainers could build it? Going only with MQTT protocol might not leverage all the intrinsic features of Nats (besides the one you mention the MQTT 3.1 and lack of headers).

damien-blanchet commented 1 month ago

Hi @zarusz, I am looking to contribute to a new transport called SlimMessageBus.Host.Nats

zarusz commented 1 month ago

Cool, let me know if you need any pointers.

I'd suggest copying one of the simpler transports (Mqtt, Redis) and starting from there. Also, be sure to provide an integration test (see any ones ending with It) and leverage test containers.

dblanchetatlectra commented 1 month ago

I've opened a PR with the Nats transport implementation I'm proposing, largely inspired by the MQTT transport implementation.

However, I have a problem with the execution of integration tests: the nats_endpoint variable is not found, even though I think I've set it correctly as an environment variable. Any idea what's going wrong?

zarusz commented 1 month ago

Great, let's discuss the int test issues over in the PR. I can see what's going on and comment there.

zarusz commented 1 month ago

Closed via #287