beetle 3.3.4 → 3.3.5

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: 9f0f8ae030c94382e66a0aa701b4cdd01a1bee74ef7b25ed21396471f5de838c
4
- data.tar.gz: d74eb42e467c68d0362e07ed93839cdb7b0107bc4fec2c93386af67f1c711d78
3
+ metadata.gz: b0f8873de6fd4f5bb2c9e9cb0e3f2b0c0f309b4e1943d81339326e0138f2f15c
4
+ data.tar.gz: c1dd5c11971051c40cb042c89a55d2b484a577f5dc6a425d228a7afadb19c63e
5
5
  SHA512:
6
- metadata.gz: 443dfa9e216c52e93aab6f8d4568369bc548cc915a367800571b148d4301e13053befa7f548522f5f8a0107e880e825b318a02f631199912d0f96ed71efe76c2
7
- data.tar.gz: 4107720120b9bab2c4d1d83e68b7e2b05caf5dac4ce5202e20bcbeb0d68f644c7d64d93b92526763f1a636a8371b9c20511e7c07aed26ca5384a3770f8e74627
6
+ metadata.gz: e74099037903ae6c08af28b9f868c9411838ee1ad4184fc1f1b49d5b0b8ac0d9b9a5b3e02e17d0919e11bbcc60799782750f77d6d7c4fba457a35706eb673f8c
7
+ data.tar.gz: fa1d47c95b9141b951e525e7fd2ca1706d00b62b05cf6803c36e29e8048cc6faee6ddefd2b417651bf27928e2aafac521ac489bcb562b88b3590765f94c40600
@@ -1,5 +1,8 @@
1
1
  = Release Notes
2
2
 
3
+ == Version 3.3.5
4
+ * Support synchronous queue policy creation.
5
+
3
6
  == Version 3.3.4
4
7
  * Track publishing policy options metrics.
5
8
 
@@ -97,13 +97,18 @@ module Beetle
97
97
  # avoid endless recursion
98
98
  return if options[:queue_name] == @client.config.beetle_policy_updates_queue_name
99
99
  payload = options.merge(:server => @server)
100
- logger.debug("Beetle: publishing policy options on #{@server}: #{payload.inspect}")
101
- # make sure to declare the queue, so the message does not get lost
102
- ActiveSupport::Notifications.instrument('publish.beetle') do
103
- queue(@client.config.beetle_policy_updates_queue_name)
104
- data = payload.to_json
105
- opts = Message.publishing_options(:key => @client.config.beetle_policy_updates_routing_key, :persistent => true, :redundant => false)
106
- exchange(@client.config.beetle_policy_exchange_name).publish(data, opts)
100
+ if @client.config.update_queue_properties_synchronously
101
+ logger.debug("Beetle: updating policy options on #{@server}: #{payload.inspect}")
102
+ @client.update_queue_properties!(payload)
103
+ else
104
+ logger.debug("Beetle: publishing policy options on #{@server}: #{payload.inspect}")
105
+ # make sure to declare the queue, so the message does not get lost
106
+ ActiveSupport::Notifications.instrument('publish.beetle') do
107
+ queue(@client.config.beetle_policy_updates_queue_name)
108
+ data = payload.to_json
109
+ opts = Message.publishing_options(:key => @client.config.beetle_policy_updates_routing_key, :persistent => true, :redundant => false)
110
+ exchange(@client.config.beetle_policy_exchange_name).publish(data, opts)
111
+ end
107
112
  end
108
113
  end
109
114
 
@@ -97,10 +97,13 @@ module Beetle
97
97
  attr_accessor :dead_lettering_enabled
98
98
  alias_method :dead_lettering_enabled?, :dead_lettering_enabled
99
99
 
100
- # the time a message spends in the dead letter queue if dead lettering is enabled, before it is returned
100
+ # The time a message spends in the dead letter queue if dead lettering is enabled, before it is returned
101
101
  # to the original queue
102
102
  attr_accessor :dead_lettering_msg_ttl
103
103
 
104
+ # Whether to update quueue policies synchronously or asynchronously.
105
+ attr_accessor :update_queue_properties_synchronously
106
+
104
107
  # Read timeout for http requests to create dead letter bindings
105
108
  attr_accessor :rabbitmq_api_read_timeout
106
109
 
@@ -175,6 +178,8 @@ module Beetle
175
178
  self.lazy_queues_enabled = false
176
179
  self.throttling_refresh_interval = 60 # seconds
177
180
 
181
+ self.update_queue_properties_synchronously = false
182
+
178
183
  self.publishing_timeout = 0
179
184
  self.publisher_connect_timeout = 5 # seconds
180
185
  self.tmpdir = "/tmp"
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "3.3.4"
2
+ VERSION = "3.3.5"
3
3
  end
@@ -104,5 +104,13 @@ module Beetle
104
104
  @bs.__send__(:publish_policy_options, options)
105
105
  end
106
106
 
107
+ test "publish_policy_options calls the RabbitMQ API if asked to do so" do
108
+ options = { :lazy => true, :dead_lettering => true }
109
+ @bs.logger.stubs(:debug)
110
+ @client.config.expects(:update_queue_properties_synchronously).returns(true)
111
+ @client.expects(:update_queue_properties!).with(options.merge(:server => "localhost:5672"))
112
+ @bs.__send__(:publish_policy_options, options)
113
+ end
114
+
107
115
  end
108
116
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-04-06 00:00:00.000000000 Z
15
+ date: 2020-04-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bunny