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.45k stars 799 forks source link

pubsub/rabbitpubsub: add support to routing key via url query string #3432

Closed peczenyj closed 1 month ago

peczenyj commented 1 month ago

Is your feature request related to a problem? Please describe.

the pubsub/rabbitpubsub driver was designed to work with topics, and it always send an empty routing key. However it is frustrating when an exchange of type x-modulus-hash (see https://github.com/rabbitmq/rabbitmq-sharding )

Describe the solution you'd like

Today the pubsub/kafkapubsub driver supports a query string key_name to define a metadata key to be used as routing key instead generic metadata. I'd like to do the same with rabbitmq

Describe alternatives you've considered

I have no alternatives :/