rabbitmq-stream-go-client
rabbitmq-stream-go-client copied to clipboard
Add code documentation
Request to add basic comments to public-facing functions, as well as better descriptions of how/where to close producers/consumers to improve usability as opposed to relying on examples that do everything in one function
Hi @gbl-tylers Thank you for reporting. There is already the documentation: https://github.com/rabbitmq/rabbitmq-stream-go-client#overview
What part is not clear? Feel free to open a PR to improve the documentation btw.
There's two particular issues/questions we had:
- Connecting with a custom port (5553). underlying function defaults to 5552 instead, and we were not able to find exactly where this value was being inserted in, if it was in code or getting something from rabbitmq that we had not correctly configured
- At which point we should close the consumer and if we are using this in an actual application, should we call the consumer in a go routine?
The documentation you linked is fine, it was more just when trying to integrate with what we had, it was a bit difficult as many functions / structs we used in the package didn't have any comments about how to use them
Connecting with a custom port (5553).
It is in the https://github.com/rabbitmq/rabbitmq-stream-go-client#connect
-
SetPort(xxxx).
At which point we should close the consumer.
When you don't need to consume messages anymore.
and if we are using this in an actual application, should we call the consumer in a go routine?
It depends on your application. From the Client-side perspective, it does not change anything.
it was a bit difficult as many functions / structs we used in the package didn't have any comments about how to use them
We will add documentation on the functions
Added the documentation "How to close the producer/consumer" via https://github.com/rabbitmq/rabbitmq-stream-go-client/commit/4fb561de60ebfb14cdbffd9054c794cc7f7fa638