google / go-cloud

The Go Cloud Development Kit (Go CDK): A library and tools for open cloud development in Go.
https://gocloud.dev/
Apache License 2.0
9.57k stars 812 forks source link

pubsub/rabbitpubsub: add query string set the qos prefetch count #3431

Closed peczenyj closed 6 months ago

peczenyj commented 6 months ago

Fixes #3430

Since we usually want to set the prefetch count, I simplify the rabbit url to support a single query string

we can use rabbit://myqueue (continues backward compatible) or the new one rabbit://myqueue?prefetch_count=<prefetch-count-value>

I tested locally using a rabbitmq docker image and it seems to work properly.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 73.26%. Comparing base (d8b9c94) to head (ca2c5a2).

Files Patch % Lines
pubsub/rabbitpubsub/rabbit.go 77.77% 4 Missing and 2 partials :warning:
pubsub/rabbitpubsub/amqp.go 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3431 +/- ## ========================================== + Coverage 73.21% 73.26% +0.04% ========================================== Files 113 113 Lines 14873 14897 +24 ========================================== + Hits 10890 10914 +24 + Misses 3211 3207 -4 - Partials 772 776 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.