Skip to content

Commit

Permalink
Use different consumer concurrency levels and acknowledgement modes i…
Browse files Browse the repository at this point in the history
…n this test
  • Loading branch information
michaelklishin committed Jan 9, 2019
1 parent 4dd2eb8 commit 0932bc4
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions spec/higher_level_api/integration/merry_go_round_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
c = Bunny.new(username: "bunny_gem",
password: "bunny_password",
vhost: "bunny_testbed",
heartbeat: 6)
heartbeat_timeout: 6)
c.start
c
end
Expand All @@ -14,7 +14,7 @@
c = Bunny.new(username: "bunny_gem",
password: "bunny_password",
vhost: "bunny_testbed",
heartbeat: 6)
heartbeat_timeout: 6)
c.start
c
end
Expand All @@ -23,7 +23,7 @@
c = Bunny.new(username: "bunny_gem",
password: "bunny_password",
vhost: "bunny_testbed",
heartbeat: 6)
heartbeat_timeout: 6)
c.start
c
end
Expand All @@ -32,7 +32,7 @@
c = Bunny.new(username: "bunny_gem",
password: "bunny_password",
vhost: "bunny_testbed",
heartbeat: 6)
heartbeat_timeout: 6)
c.start
c
end
Expand All @@ -41,7 +41,7 @@
c = Bunny.new(username: "bunny_gem",
password: "bunny_password",
vhost: "bunny_testbed",
heartbeat: 6)
heartbeat_timeout: 6)
c.start
c
end
Expand All @@ -56,13 +56,14 @@
#
# x => q4 => q3 => q2 => q1 => xs (results)
it "reaches its final destination" do
n = 30_000
n = 50_000
xs = []

ch1 = c1.create_channel
q1 = ch1.queue("", exclusive: true)
q1.subscribe do |_, _, payload|
q1.subscribe(manual_ack: true) do |delivery_info, _, payload|
xs << payload
ch1.ack(delivery_info.delivery_tag)
end

ch2 = c2.create_channel
Expand All @@ -71,19 +72,20 @@
q1.publish(payload)
end

ch3 = c3.create_channel
q3 = ch2.queue("", exclusive: true)
q3.subscribe do |_, _, payload|
ch3 = c3.create_channel(nil, 2)
q3 = ch3.queue("", exclusive: true)
q3.subscribe(manual_ack: true) do |delivery_info, _, payload|
q2.publish(payload)
ch3.ack(delivery_info.delivery_tag)
end

ch4 = c4.create_channel
q4 = ch2.queue("", exclusive: true)
ch4 = c4.create_channel(nil, 4)
q4 = ch4.queue("", exclusive: true)
q4.subscribe do |_, _, payload|
q3.publish(payload)
end

ch5 = c5.create_channel
ch5 = c5.create_channel(nil, 8)
x = ch5.default_exchange

n.times do |i|
Expand Down

0 comments on commit 0932bc4

Please sign in to comment.