twingly / twingly-amqp

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

Let TopicExchangePublisher#publish accept routing_key #60

Closed walro closed 9 months ago

walro commented 7 years ago

Would be handy incase you want to publish messages with different routing keys. Right now you'd need to "reconfigure" the instance via its configuration block to change the routing key. That's a bit awkward way of doing it, e.g:

# right now
publisher.configure_publish_options do |config|
  config.routing_key = "new_key"
end

publisher.publish(message)

# better
publisher.publish(message, routing_key: "new_key") # overrides the configured routing_key, if any