bunny 2.19.0 → 2.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -32
- data/lib/bunny/channel.rb +86 -10
- data/lib/bunny/consumer.rb +2 -2
- data/lib/bunny/delivery_info.rb +1 -1
- data/lib/bunny/queue.rb +33 -2
- data/lib/bunny/session.rb +1 -1
- data/lib/bunny/transport.rb +30 -1
- data/lib/bunny/version.rb +1 -1
- data/lib/bunny.rb +45 -4
- metadata +4 -144
- data/spec/config/enabled_plugins +0 -1
- data/spec/config/rabbitmq.conf +0 -13
- data/spec/higher_level_api/integration/basic_ack_spec.rb +0 -230
- data/spec/higher_level_api/integration/basic_cancel_spec.rb +0 -142
- data/spec/higher_level_api/integration/basic_consume_spec.rb +0 -357
- data/spec/higher_level_api/integration/basic_consume_with_objects_spec.rb +0 -54
- data/spec/higher_level_api/integration/basic_get_spec.rb +0 -80
- data/spec/higher_level_api/integration/basic_nack_spec.rb +0 -82
- data/spec/higher_level_api/integration/basic_publish_spec.rb +0 -74
- data/spec/higher_level_api/integration/basic_qos_spec.rb +0 -57
- data/spec/higher_level_api/integration/basic_reject_spec.rb +0 -152
- data/spec/higher_level_api/integration/basic_return_spec.rb +0 -33
- data/spec/higher_level_api/integration/channel_close_spec.rb +0 -66
- data/spec/higher_level_api/integration/channel_open_spec.rb +0 -57
- data/spec/higher_level_api/integration/connection_recovery_spec.rb +0 -483
- data/spec/higher_level_api/integration/connection_spec.rb +0 -589
- data/spec/higher_level_api/integration/connection_stop_spec.rb +0 -83
- data/spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb +0 -128
- data/spec/higher_level_api/integration/dead_lettering_spec.rb +0 -75
- data/spec/higher_level_api/integration/exchange_bind_spec.rb +0 -31
- data/spec/higher_level_api/integration/exchange_declare_spec.rb +0 -237
- data/spec/higher_level_api/integration/exchange_delete_spec.rb +0 -105
- data/spec/higher_level_api/integration/exchange_unbind_spec.rb +0 -40
- data/spec/higher_level_api/integration/exclusive_queue_spec.rb +0 -28
- data/spec/higher_level_api/integration/heartbeat_spec.rb +0 -49
- data/spec/higher_level_api/integration/message_properties_access_spec.rb +0 -95
- data/spec/higher_level_api/integration/predeclared_exchanges_spec.rb +0 -24
- data/spec/higher_level_api/integration/publisher_confirms_spec.rb +0 -191
- data/spec/higher_level_api/integration/publishing_edge_cases_spec.rb +0 -87
- data/spec/higher_level_api/integration/queue_bind_spec.rb +0 -109
- data/spec/higher_level_api/integration/queue_declare_spec.rb +0 -285
- data/spec/higher_level_api/integration/queue_delete_spec.rb +0 -41
- data/spec/higher_level_api/integration/queue_purge_spec.rb +0 -30
- data/spec/higher_level_api/integration/queue_unbind_spec.rb +0 -54
- data/spec/higher_level_api/integration/read_only_consumer_spec.rb +0 -60
- data/spec/higher_level_api/integration/sender_selected_distribution_spec.rb +0 -36
- data/spec/higher_level_api/integration/tls_connection_spec.rb +0 -255
- data/spec/higher_level_api/integration/toxiproxy_spec.rb +0 -76
- data/spec/higher_level_api/integration/tx_commit_spec.rb +0 -21
- data/spec/higher_level_api/integration/tx_rollback_spec.rb +0 -21
- data/spec/higher_level_api/integration/with_channel_spec.rb +0 -25
- data/spec/issues/issue100_spec.rb +0 -42
- data/spec/issues/issue141_spec.rb +0 -43
- data/spec/issues/issue202_spec.rb +0 -15
- data/spec/issues/issue224_spec.rb +0 -40
- data/spec/issues/issue465_spec.rb +0 -32
- data/spec/issues/issue549_spec.rb +0 -30
- data/spec/issues/issue609_spec.rb +0 -84
- data/spec/issues/issue78_spec.rb +0 -72
- data/spec/issues/issue83_spec.rb +0 -30
- data/spec/issues/issue97_attachment.json +0 -1
- data/spec/issues/issue97_spec.rb +0 -175
- data/spec/lower_level_api/integration/basic_cancel_spec.rb +0 -83
- data/spec/lower_level_api/integration/basic_consume_spec.rb +0 -99
- data/spec/spec_helper.rb +0 -47
- data/spec/stress/channel_close_stress_spec.rb +0 -64
- data/spec/stress/channel_open_stress_spec.rb +0 -84
- data/spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb +0 -28
- data/spec/stress/concurrent_consumers_stress_spec.rb +0 -71
- data/spec/stress/concurrent_publishers_stress_spec.rb +0 -54
- data/spec/stress/connection_open_close_spec.rb +0 -52
- data/spec/stress/merry_go_round_spec.rb +0 -105
- data/spec/toxiproxy_helper.rb +0 -28
- data/spec/unit/bunny_spec.rb +0 -15
- data/spec/unit/concurrent/atomic_fixnum_spec.rb +0 -35
- data/spec/unit/concurrent/condition_spec.rb +0 -82
- data/spec/unit/concurrent/linked_continuation_queue_spec.rb +0 -35
- data/spec/unit/concurrent/synchronized_sorted_set_spec.rb +0 -73
- data/spec/unit/exchange_recovery_spec.rb +0 -39
- data/spec/unit/version_delivery_tag_spec.rb +0 -28
data/spec/issues/issue78_spec.rb
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
unless ENV["CI"]
|
4
|
-
describe Bunny::Queue, "#subscribe" do
|
5
|
-
before :all do
|
6
|
-
@connection1 = Bunny.new(:user => "bunny_gem", password: "bunny_password", :vhost => "bunny_testbed")
|
7
|
-
@connection1.start
|
8
|
-
@connection2 = Bunny.new(:user => "bunny_gem", password: "bunny_password", :vhost => "bunny_testbed")
|
9
|
-
@connection2.start
|
10
|
-
end
|
11
|
-
|
12
|
-
after :all do
|
13
|
-
[@connection1, @connection2].select { |c| !!c }.each do |c|
|
14
|
-
c.close if c.open?
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
context "with an empty queue" do
|
20
|
-
it "consumes messages" do
|
21
|
-
delivered_data = []
|
22
|
-
|
23
|
-
ch1 = @connection1.create_channel
|
24
|
-
ch2 = @connection1.create_channel
|
25
|
-
|
26
|
-
q = ch1.queue("", exclusive: true)
|
27
|
-
q.subscribe(manual_ack: false) do |delivery_info, properties, payload|
|
28
|
-
delivered_data << payload
|
29
|
-
end
|
30
|
-
sleep 0.5
|
31
|
-
|
32
|
-
x = ch2.default_exchange
|
33
|
-
x.publish("abc", routing_key: q.name)
|
34
|
-
sleep 0.7
|
35
|
-
|
36
|
-
expect(delivered_data).to eq ["abc"]
|
37
|
-
|
38
|
-
ch1.close
|
39
|
-
ch2.close
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "with a non-empty queue" do
|
44
|
-
let(:queue_name) { "queue#{rand}" }
|
45
|
-
|
46
|
-
it "consumes messages" do
|
47
|
-
delivered_data = []
|
48
|
-
|
49
|
-
ch1 = @connection1.create_channel
|
50
|
-
ch2 = @connection1.create_channel
|
51
|
-
|
52
|
-
q = ch1.queue(queue_name, exclusive: true)
|
53
|
-
x = ch2.default_exchange
|
54
|
-
3.times do |i|
|
55
|
-
x.publish("data#{i}", routing_key: queue_name)
|
56
|
-
end
|
57
|
-
sleep 0.7
|
58
|
-
expect(q.message_count).to eq 3
|
59
|
-
|
60
|
-
q.subscribe(manual_ack: false) do |delivery_info, properties, payload|
|
61
|
-
delivered_data << payload
|
62
|
-
end
|
63
|
-
sleep 0.7
|
64
|
-
|
65
|
-
expect(delivered_data).to eq ["data0", "data1", "data2"]
|
66
|
-
|
67
|
-
ch1.close
|
68
|
-
ch2.close
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
data/spec/issues/issue83_spec.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Bunny::Channel, "#open" do
|
4
|
-
before :all do
|
5
|
-
@connection = Bunny.new(:user => "bunny_gem", password: "bunny_password", :vhost => "bunny_testbed")
|
6
|
-
@connection.start
|
7
|
-
end
|
8
|
-
|
9
|
-
after :all do
|
10
|
-
@connection.close if @connection.open?
|
11
|
-
end
|
12
|
-
|
13
|
-
|
14
|
-
it "properly resets channel exception state" do
|
15
|
-
ch = @connection.create_channel
|
16
|
-
|
17
|
-
begin
|
18
|
-
ch.queue("bunny.tests.does.not.exist", :passive => true)
|
19
|
-
rescue Bunny::NotFound
|
20
|
-
# expected
|
21
|
-
end
|
22
|
-
|
23
|
-
# reopen the channel
|
24
|
-
ch.open
|
25
|
-
|
26
|
-
# should not raise
|
27
|
-
q = ch.queue("bunny.tests.my.queue")
|
28
|
-
q.delete
|
29
|
-
end
|
30
|
-
end
|