bunny 2.11.0.pre1 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/connection/automatic_recovery_with_basic_get.rb +1 -1
- data/examples/connection/automatic_recovery_with_client_named_queues.rb +1 -1
- data/examples/connection/automatic_recovery_with_multiple_consumers.rb +1 -1
- data/examples/connection/automatic_recovery_with_republishing.rb +1 -1
- data/examples/connection/automatic_recovery_with_server_named_queues.rb +1 -1
- data/examples/connection/channel_level_exception.rb +1 -1
- data/examples/connection/disabled_automatic_recovery.rb +1 -1
- data/examples/connection/heartbeat.rb +1 -1
- data/examples/consumers/high_and_low_priority.rb +1 -1
- data/lib/bunny/session.rb +7 -3
- data/lib/bunny/version.rb +1 -1
- data/spec/higher_level_api/integration/connection_spec.rb +1 -1
- data/spec/higher_level_api/integration/heartbeat_spec.rb +3 -3
- data/spec/stress/long_running_consumer_spec.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30bc96b65edcb9a0d976408669ca1af4654e5a8a
|
4
|
+
data.tar.gz: 144a71c34e3f0cc04024dd7d80eb400fd1834a36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f85596d0dd8e731f6d6bf6719d3f1324690762c61f2829ad65125a4b55d833c000b574f90160e956fefbff930519e9d33fab30723cb9b0a00de85e3252a208ae
|
7
|
+
data.tar.gz: 60ee0016f188410417f8742c24850fa57260808759c2c95f71f4c9ea2ea2cf9e940ea170b4503f6bca800f7ccf0cae5eabe382ebf00dbd432ad6337e64febcad
|
@@ -8,7 +8,7 @@ $:.unshift(File.expand_path("../../../lib", __FILE__))
|
|
8
8
|
|
9
9
|
require 'bunny'
|
10
10
|
|
11
|
-
conn = Bunny.new(:
|
11
|
+
conn = Bunny.new(heartbeat_timeout: 8, automatically_recover: false)
|
12
12
|
conn.start
|
13
13
|
|
14
14
|
ch = conn.create_channel
|
@@ -11,7 +11,7 @@ require 'bunny'
|
|
11
11
|
HIGH_PRIORITY_Q = "bunny.examples.priority.hilo.high"
|
12
12
|
LOW_PRIORITY_Q = "bunny.examples.priority.hilo.low"
|
13
13
|
|
14
|
-
conn = Bunny.new(:
|
14
|
+
conn = Bunny.new(heartbeat_timeout: 8)
|
15
15
|
conn.start
|
16
16
|
|
17
17
|
ch1 = conn.create_channel
|
data/lib/bunny/session.rb
CHANGED
@@ -101,7 +101,7 @@ module Bunny
|
|
101
101
|
# @option connection_string_or_opts [String] :username ("guest") Username
|
102
102
|
# @option connection_string_or_opts [String] :password ("guest") Password
|
103
103
|
# @option connection_string_or_opts [String] :vhost ("/") Virtual host to use
|
104
|
-
# @option connection_string_or_opts [Integer, Symbol] :heartbeat (:server) Heartbeat
|
104
|
+
# @option connection_string_or_opts [Integer, Symbol] :heartbeat (:server) Heartbeat timeout to offer to the server. :server means use the value suggested by RabbitMQ. 0 means heartbeats and socket read timeouts will be disabled (not recommended).
|
105
105
|
# @option connection_string_or_opts [Integer] :network_recovery_interval (4) Recovery interval periodic network recovery will use. This includes initial pause after network failure.
|
106
106
|
# @option connection_string_or_opts [Boolean] :tls (false) Should TLS/SSL be used?
|
107
107
|
# @option connection_string_or_opts [String] :tls_cert (nil) Path to client TLS/SSL certificate file (.pem)
|
@@ -233,9 +233,13 @@ module Bunny
|
|
233
233
|
# @return [String] Virtual host used
|
234
234
|
def virtual_host; self.vhost; end
|
235
235
|
|
236
|
-
# @
|
236
|
+
# @deprecated
|
237
|
+
# @return [Integer] Heartbeat timeout (not interval) used
|
237
238
|
def heartbeat_interval; self.heartbeat; end
|
238
239
|
|
240
|
+
# @return [Integer] Heartbeat timeout used
|
241
|
+
def heartbeat_timeout; self.heartbeat; end
|
242
|
+
|
239
243
|
# @return [Boolean] true if this connection uses TLS (SSL)
|
240
244
|
def uses_tls?
|
241
245
|
@transport.uses_tls?
|
@@ -944,7 +948,7 @@ module Bunny
|
|
944
948
|
|
945
949
|
# @private
|
946
950
|
def heartbeat_from(options)
|
947
|
-
options[:heartbeat] || options[:
|
951
|
+
options[:heartbeat] || options[:heartbeat_timeout] || options[:requested_heartbeat] || options[:heartbeat_interval] || DEFAULT_HEARTBEAT
|
948
952
|
end
|
949
953
|
|
950
954
|
# @private
|
data/lib/bunny/version.rb
CHANGED
@@ -462,7 +462,7 @@ describe Bunny::Session do
|
|
462
462
|
let(:interval) { 1 }
|
463
463
|
|
464
464
|
subject do
|
465
|
-
described_class.new(hostname: host, username: username, password: password, vhost: vhost,
|
465
|
+
described_class.new(hostname: host, username: username, password: password, vhost: vhost, heartbeat_timeout: interval)
|
466
466
|
end
|
467
467
|
|
468
468
|
it "successfully connects" do
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe "Client-defined heartbeat interval" do
|
4
4
|
context "with value > 0" do
|
5
5
|
let(:connection) do
|
6
|
-
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed",
|
6
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed", heartbeat_timeout: 4)
|
7
7
|
c.start
|
8
8
|
c
|
9
9
|
end
|
@@ -19,7 +19,7 @@ describe "Client-defined heartbeat interval" do
|
|
19
19
|
context "with value = 0" do
|
20
20
|
let(:connection) do
|
21
21
|
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed",
|
22
|
-
|
22
|
+
heartbeat_timeout: 0, automatically_recover: false)
|
23
23
|
c.start
|
24
24
|
c
|
25
25
|
end
|
@@ -35,7 +35,7 @@ end
|
|
35
35
|
|
36
36
|
describe "Server-defined heartbeat interval" do
|
37
37
|
let(:connection) do
|
38
|
-
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed",
|
38
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed", heartbeat_timeout: :server)
|
39
39
|
c.start
|
40
40
|
c
|
41
41
|
end
|
@@ -9,7 +9,7 @@ unless ENV["CI"]
|
|
9
9
|
before :all do
|
10
10
|
@connection = Bunny.new(username: "bunny_gem",
|
11
11
|
password: "bunny_password", vhost: "bunny_testbed",
|
12
|
-
automatic_recovery: false,
|
12
|
+
automatic_recovery: false, heartbeat_timeout: 6)
|
13
13
|
@connection.start
|
14
14
|
end
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.0
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Duncan
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2018-06-
|
15
|
+
date: 2018-06-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: amq-protocol
|
@@ -227,9 +227,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
227
227
|
version: '2.2'
|
228
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
229
229
|
requirements:
|
230
|
-
- - "
|
230
|
+
- - ">="
|
231
231
|
- !ruby/object:Gem::Version
|
232
|
-
version:
|
232
|
+
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
235
|
rubygems_version: 2.6.11
|