springwolf / springwolf-core

Automated documentation for event-driven applications built with Spring Boot
https://www.springwolf.dev
Apache License 2.0
245 stars 69 forks source link

Feature request: Support NATS #307

Closed skarpushin closed 10 months ago

skarpushin commented 1 year ago

Describe the feature request Add support for NATS https://nats.io/

Motivation NATS adoption increases and in some scenarios it exceeds Kafka. So it would be really nice if SpringWolf would also support NATS.

Technical details n/a

Describe alternatives you've considered n/a

github-actions[bot] commented 1 year ago

Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.

timonback commented 1 year ago

Thank you for this request.

Springwolf supports what AsyncAPI supports. I haven't found a binding for NATS, but have found an example, which skips the binding to specific servers: https://github.com/asyncapi/dotnet-nats-template/blob/master/examples/streetlight.json

Based on the Baeldung article 0, I see that the application is manually configured to receive and publish messages (no NATS specific annotation).

Have you tried to use the @AsyncListener annotation on the receiving method?

skarpushin commented 1 year ago

@timonback thank you for elaborate answer! I did not try it yet, but I will.

I didn't find NATS plugin in https://github.com/springwolf/springwolf-core/tree/master/springwolf-plugins so I thought NATS is not supported. But I will try @AsyncListener for sure to double-check.

timonback commented 1 year ago

I just noticed that NATS is supported by AsyncApi as a binding.

After https://github.com/springwolf/springwolf-core/issues/288 has been solved, NATS can be specified explicitly.

timonback commented 10 months ago

Thank you for the report, the issue has been addressed in the new release.

The website will be updated soon on how to use the springwolf-generic-binding plugin, which allows to document all bindings - including NATS. Preview of the changes: https://github.com/springwolf/springwolf.github.io/pull/62/files#diff-07b414902f2f07f5c083d5a81a4ee3730ad48b61787224581b2160a2f5b13c05

Feel free to reopen this issue if there is still something missing.