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 +4 -4
- data/RELEASE_NOTES.rdoc +3 -0
- data/lib/beetle/base.rb +12 -7
- data/lib/beetle/configuration.rb +6 -1
- data/lib/beetle/version.rb +1 -1
- data/test/beetle/base_test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0f8873de6fd4f5bb2c9e9cb0e3f2b0c0f309b4e1943d81339326e0138f2f15c
|
4
|
+
data.tar.gz: c1dd5c11971051c40cb042c89a55d2b484a577f5dc6a425d228a7afadb19c63e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e74099037903ae6c08af28b9f868c9411838ee1ad4184fc1f1b49d5b0b8ac0d9b9a5b3e02e17d0919e11bbcc60799782750f77d6d7c4fba457a35706eb673f8c
|
7
|
+
data.tar.gz: fa1d47c95b9141b951e525e7fd2ca1706d00b62b05cf6803c36e29e8048cc6faee6ddefd2b417651bf27928e2aafac521ac489bcb562b88b3590765f94c40600
|
data/RELEASE_NOTES.rdoc
CHANGED
data/lib/beetle/base.rb
CHANGED
@@ -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
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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
|
|
data/lib/beetle/configuration.rb
CHANGED
@@ -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
|
-
#
|
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"
|
data/lib/beetle/version.rb
CHANGED
data/test/beetle/base_test.rb
CHANGED
@@ -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
|
+
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-
|
15
|
+
date: 2020-04-07 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bunny
|