-
Notifications
You must be signed in to change notification settings - Fork 436
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
[frontend] Publish on the rabbitmq exchange #4027
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4027 +/- ##
==========================================
+ Coverage 89.2% 89.21% +<.01%
==========================================
Files 308 308
Lines 18200 18199 -1
==========================================
Hits 16236 16236
+ Misses 1964 1963 -1
|
src/api/lib/rabbitmq_bus.rb
Outdated
@@ -3,8 +3,7 @@ def self.publish(event_queue_name, event_payload) | |||
return unless CONFIG['amqp_options'] | |||
start_connection | |||
|
|||
queue = $rabbitmq_channel.queue(event_queue_name, CONFIG['amqp_queue_options'].try(:with_indifferent_access) || {}) | |||
$rabbitmq_exchange.publish(event_payload, routing_key: queue.name) | |||
$rabbitmq_exchange.publish(event_payload, routing_key: event_queue_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually self.class.message_bus_queue is already a misnomer. We don't want different queues per event type, just different routing keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that is a PITA but I would prefer to change the name if it doesn't really make sense... something like self.class.message_bus_route
is better??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also then changing event_queue_name
to event_route
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion would be better than what we have. To quote from the net: "A message goes to the queue(s) whose binding key exactly matches the routing key of the message.". What we are passing here is that routing key - so possibly we would be most correct if we called it event_routing_key
[webui][api] Update Event classes to publish only once.
8f4e25c
to
96957ff
Compare
please re-review |
start_connection declares the exchange, so just publish on this one instead
of creating one queue per event type.