twingly / twingly-amqp

:bus: Ruby gem for RabbitMQ subscribing and publishing
0 stars 0 forks source link

Be able to subscribe to multiple routing keys #69

Closed roback closed 5 years ago

roback commented 5 years ago

RabbitMQ lets you bind a queue to an exchange using multiple different routing keys. Shouldn't be a big change, I think we just need to add a loop at https://github.com/twingly/twingly-amqp/blob/e4022700cc04c42fc231a3a73d026e68f59d2e83/lib/twingly/amqp/subscription.rb#L23

In nile we do it in the following way: https://github.com/twingly/nile/blob/7f3d9ca60ba22d86cc63dd986c082e6cfcbaf42f/lib/binlog_queue.rb#L27-L29

    @routing_keys.each do |routing_key|
      queue.bind(exchange, routing_key: routing_key)
    end