-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to set queue name prefix #226
Comments
Use separate vhosts? |
The issue by using seperate vhosts is that Service A publishes an event on vhost X, Service B consumes events on vhost Y. Not sure how you can configure rabbitmq to broadcast messages across vhosts. |
Are your consumers reused between services? If not, it should be safe to include prefixes into queue names manually. |
No each services define their set of consumers. The issues comes down to naming consumers and therefor rabbitmq queues. Let's say Service A define a consumer called To avoid this issue a simple solution is to name the consumers based on what they do instead of on what they consume. Service A : It also have the advantage of being easy to identify the intent of each consumers. While this works fine, it's not helpful when you want to apply rabbitmq policies to all the queues of Service B. Let's say you want to set a TTL on each messages in Service B queues. You can use rabbitmq policies but you need a queue pattern to match against. With a queue name prefix, it's easier: Now, I know we can set queue name per consumer but what I was suggesting is a global config on hutch to prefix each queues with some string. On Service B Hutch::Config.set :queue_prefix, "service_b" Does that make sense? |
I also would like your feedback on this. I'm in a situation where we use hutch in multiple services. Each consumers is namespaced under a
consumer
ruby module. We try to name our consumers based on what they actually do but i'm afraid of name collision.So the idea would be to prefix all queues with some name, like our service name. Also, it would help to setup rabbitmq policies by pattern matching all queues that have their name starting by the service name.
What's your input on this?
The text was updated successfully, but these errors were encountered: