bunny 2.16.1 → 2.17.0

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94a05191f06bd28c3c4714a67c70a5097341f7d07961cb97df83ad5414a0e541
4
- data.tar.gz: 3521b4979e62eb7a5d6c1f54cb5a17cbda33706f696288ec2c8a0ee0397c3ddf
3
+ metadata.gz: 3f3ba4a5565a42eace00f8789c1be953871d9dc57d42028a94a9dd70a586271e
4
+ data.tar.gz: c7d2fdf832b466a27c7ae884e6195729d31a6bf1cb6accde9818c2f72b46cdc6
5
5
  SHA512:
6
- metadata.gz: 54314055b9f79e3c334d461f0a63f17fa50e7fe0b39fa71a9314b194db02a8416a057e66123f8b2d7d13353b69f018799a785dd59ea54eeea3d882ec8511b650
7
- data.tar.gz: 9721730e57e5da633568b859f8df0feada37d4303b94f68e78d6a291d0d9d2e6409fa5a7fdcbb59ea5cb5a557c04e750ec7a1098496ab439bd2077b260ea4c3c
6
+ metadata.gz: 26a352492ca652429975e45ec36fad12ebfd3c94e66babb879afb0f09dcec0158affc820f8a29fd07a25d8db6ac9312fd31ebc5b1a3d4c315ecfeeb880a5a8f2
7
+ data.tar.gz: 393fa99fb87c7784eccd0f5019fe3668b39064e15935d85f4134c85aa6b138849d0026addb814f49d00f606b9157b78878863c875d2ad6480b17b3053dcb98fb
@@ -1,8 +1,35 @@
1
- ## Changes between Bunny 2.16.0 and 2.17.0 (undefined)
1
+ ## Changes between Bunny 2.17.x and 2.18.0 (in development)
2
2
 
3
3
  No changes yet.
4
4
 
5
5
 
6
+ ## Changes between Bunny 2.16.x and 2.17.0 (Sep 11th, 2020)
7
+
8
+ ### Easier to Specify a Client-Propvided Connection Name
9
+
10
+ It is now easier to provide a client-provided (custom) connection
11
+ name that will be displayed in the RabbitMQ management UI and mentioned in
12
+ [server logs](https://www.rabbitmq.com/logging.html).
13
+
14
+ Instead of
15
+
16
+ ``` ruby
17
+ conn = Bunny.new(client_properties: {connection_name: 'app ABC #{rand}'})
18
+ conn.start
19
+ ```
20
+
21
+ a new top-level connection option now can be used:
22
+
23
+ ``` ruby
24
+ conn = Bunny.new(connection_name: 'app ABC #{rand}')
25
+ conn.start
26
+ ```
27
+
28
+ Contributed by @brerx.
29
+
30
+ GitHub issue: [ruby-amqp/bunny#600](https://github.com/ruby-amqp/bunny/pull/600)
31
+
32
+
6
33
  ## Changes between Bunny 2.15.0 and 2.16.0 (Aug 14th, 2020)
7
34
 
8
35
  ### Asynchronous Exception Delegate
data/README.md CHANGED
@@ -43,12 +43,11 @@ Specific examples:
43
43
  Web applications that display that information in the real time.
44
44
 
45
45
 
46
-
47
46
  ## Supported Ruby Versions
48
47
 
49
48
  Modern Bunny versions support
50
49
 
51
- * CRuby 2.3 through 2.6 (inclusive)
50
+ * CRuby 2.3 through 2.7 (inclusive)
52
51
 
53
52
  Bunny works sufficiently well on JRuby but there are known
54
53
  JRuby bugs in versions prior to JRuby 9000 that cause high CPU burn. JRuby users should
@@ -71,10 +70,10 @@ a stable public API.
71
70
  Change logs per release series:
72
71
 
73
72
  * [master](https://github.com/ruby-amqp/bunny/blob/master/ChangeLog.md)
74
- * [2.14.x](https://github.com/ruby-amqp/bunny/blob/2.13.x-stable/ChangeLog.md)
73
+ * [2.16.x](https://github.com/ruby-amqp/bunny/blob/2.16.x-stable/ChangeLog.md)
74
+ * [2.15.x](https://github.com/ruby-amqp/bunny/blob/2.15.x-stable/ChangeLog.md)
75
+ * [2.14.x](https://github.com/ruby-amqp/bunny/blob/2.14.x-stable/ChangeLog.md)
75
76
  * [2.13.x](https://github.com/ruby-amqp/bunny/blob/2.13.x-stable/ChangeLog.md)
76
- * [2.12.x](https://github.com/ruby-amqp/bunny/blob/2.12.x-stable/ChangeLog.md)
77
- * [2.11.x](https://github.com/ruby-amqp/bunny/blob/2.11.x-stable/ChangeLog.md)
78
77
 
79
78
 
80
79
 
@@ -97,7 +96,7 @@ gem install bunny
97
96
  To use Bunny in a project managed with Bundler:
98
97
 
99
98
  ``` ruby
100
- gem "bunny", ">= 2.14.1"
99
+ gem "bunny", ">= 2.16.1"
101
100
  ```
102
101
 
103
102
 
@@ -89,6 +89,7 @@ module Bunny
89
89
  # @return [Integer] Timeout for blocking protocol operations (queue.declare, queue.bind, etc), in milliseconds. Default is 15000.
90
90
  attr_reader :continuation_timeout
91
91
  attr_reader :network_recovery_interval
92
+ attr_reader :connection_name
92
93
  attr_accessor :socket_configurator
93
94
 
94
95
  # @param [String, Hash] connection_string_or_opts Connection string or a hash of connection options
@@ -128,6 +129,7 @@ module Bunny
128
129
  #
129
130
  # @option optz [String] :auth_mechanism ("PLAIN") Authentication mechanism, PLAIN or EXTERNAL
130
131
  # @option optz [String] :locale ("PLAIN") Locale RabbitMQ should use
132
+ # @option optz [String] :connection_name (nil) Client-provided connection name, if any. Note that the value returned does not uniquely identify a connection and cannot be used as a connection identifier in HTTP API requests.
131
133
  #
132
134
  # @see http://rubybunny.info/articles/connecting.html Connecting to RabbitMQ guide
133
135
  # @see http://rubybunny.info/articles/tls.html TLS/SSL guide
@@ -198,7 +200,9 @@ module Bunny
198
200
  @client_heartbeat = self.heartbeat_from(opts)
199
201
 
200
202
  client_props = opts[:properties] || opts[:client_properties] || {}
203
+ @connection_name = client_props[:connection_name] || opts[:connection_name]
201
204
  @client_properties = DEFAULT_CLIENT_PROPERTIES.merge(client_props)
205
+ .merge(connection_name: connection_name)
202
206
  @mechanism = normalize_auth_mechanism(opts.fetch(:auth_mechanism, "PLAIN"))
203
207
  @credentials_encoder = credentials_encoder_for(@mechanism)
204
208
  @locale = @opts.fetch(:locale, DEFAULT_LOCALE)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "2.16.1"
5
+ VERSION = "2.17.0"
6
6
  end
@@ -560,4 +560,30 @@ describe Bunny::Session do
560
560
  described_class.new(logger: logger)
561
561
  end
562
562
  end
563
+
564
+ context "initialized with a custom connection name" do
565
+ it "uses provided connection name with default connection string" do
566
+ conn = Bunny.new(connection_name: 'test_name')
567
+
568
+ expect(conn.connection_name).to eq 'test_name'
569
+ end
570
+
571
+ it "uses provided connection name from client property hash" do
572
+ conn = Bunny.new(client_properties: {connection_name: 'cp/test_name'})
573
+
574
+ expect(conn.connection_name).to eq 'cp/test_name'
575
+ end
576
+
577
+ it "uses provided connection name with custom connection string" do
578
+ conn = Bunny.new('amqp://guest:guest@rabbitmq:5672', connection_name: 'test_name3')
579
+
580
+ expect(conn.connection_name).to eq 'test_name3'
581
+ end
582
+
583
+ it "uses provided connection name with hash options" do
584
+ conn = Bunny.new(user: 'user', password: 'p455w0rd', connection_name: 'test_name4')
585
+
586
+ expect(conn.connection_name).to eq 'test_name4'
587
+ end
588
+ end
563
589
  end
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.16.1
4
+ version: 2.17.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: 2020-08-14 00:00:00.000000000 Z
15
+ date: 2020-09-11 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol