ruby client: require specification of queues for which to set up policies
MODIFY
RELEASE_NOTES.rdoc
RELEASE_NOTES.rdoc
== Version 3.x.x
-* provide client method to setup all queues and queue policies.
+* provide client method to setup queues and queue policies.
Setting up queue policies on demand in publisher and subscriber is OK
for a small number of queues, publishers and subscribers. But the HTTP
API of RabbitMQ doesn't scale all that well, so that a large number

MODIFY
lib/beetle/client.rb
lib/beetle/client.rb
@@ -210,8 +210,8 @@ module Beetle
end
# declares all queues, binds them and creates/updates all policies
- def setup_all_queues_and_policies
- publisher.setup_all_queues_and_policies(queues.keys)
+ def setup_queues_and_policies(queues)
+ publisher.setup_queues_and_policies(queues)
end
# start listening to all registered queues. Calls #listen_queues internally

MODIFY
lib/beetle/publisher.rb
lib/beetle/publisher.rb
@@ -143,7 +143,7 @@ module Beetle
end
end
- def setup_all_queues_and_policies(queue_names) #:nodoc:
+ def setup_queues_and_policies(queue_names) #:nodoc:
each_server do
queue_names.each do |name|
queue(name, create_policies: true)

MODIFY
test/beetle/client_test.rb
test/beetle/client_test.rb
@@ -311,8 +311,8 @@ module Beetle
test "should delegate queue setup to the publisher instance" do
client = Client.new
client.register_queue(:queue)
- client.send(:publisher).expects(:setup_all_queues_and_policies).with(["queue"]).returns("ha!")
- assert_equal "ha!", client.setup_all_queues_and_policies
+ client.send(:publisher).expects(:setup_queues_and_policies).with(["queue"]).returns("ha!")
+ assert_equal "ha!", client.setup_queues_and_policies(["queue"])
end
test "should delegate rpc calls to the publisher instance" do

MODIFY
test/beetle/publisher_test.rb
test/beetle/publisher_test.rb
@@ -368,7 +368,7 @@ module Beetle
@pub.expects(:queue).with("queue", :create_policies => true).returns(queue).in_sequence(s)
@pub.expects(:set_current_server).with("b").in_sequence(s)
@pub.expects(:queue).with("queue", :create_policies => true).returns(queue).in_sequence(s)
- @pub.setup_all_queues_and_policies(["queue"])
+ @pub.setup_queues_and_policies(["queue"])
end
end

ruby client: require specification of queues for which to set up policies