beetle 3.3.1 → 3.3.2

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: 803a18e6acb9d08835042be267fab8251b59818aa8b6a6d1bccce49313ec6ff3
4
- data.tar.gz: 10213d5296c892cfd195ae26804333a0289c4cabd5b455fa4fd17e9e63c2ee53
3
+ metadata.gz: 7182d9c5ef7c4970ae13bbabe91b1fcdea45991fa85a4abb3f53cfca22597a88
4
+ data.tar.gz: 857b842d7c2b81ee95d374ef78d02fbe15bfbae585d6afa4988e848f1c31d164
5
5
  SHA512:
6
- metadata.gz: 351ffe68580dbfadb2f71f3ff185b47371d6e7430a075dee294ba96c35198cb4dc61ee2aacd0085f531b819ae968815282dad6301647807b0019af1e9109a516
7
- data.tar.gz: 450ebd9703761b25b7def68bd399788140cb05f11e2246589f4039d236a456e8773dd38fcf223c7e0b6477b0a2aca646e9818415c45f92f1e04d900879f21f5f
6
+ metadata.gz: 57fa3450b087d9221224e8d6700074f2ba00aef9a39cd77ffbb81709f72fa115c360f89b56741e3ece716e2d7300c5d3023ca2b4db16fd59135ac99c7dc881e3
7
+ data.tar.gz: d6acfd5c143adfb4ec75320265a1a29f97916344d2b041d5e5ee6cb023dac514b30e357a06b4ef9258847440b8ba6bfd8b938ab0df3400b3c696462fef7600ba
@@ -1,5 +1,9 @@
1
1
  = Release Notes
2
2
 
3
+ == Version 3.3.2
4
+ * Changed order of queue policy application to avoid ahead of line blocking in dead letter
5
+ queues.
6
+
3
7
  == Version 3.3.1
4
8
  * It seems that there is a certain preference on connection level when
5
9
  selecting the next message to process. We try to protect against
data/Rakefile CHANGED
@@ -30,13 +30,15 @@ namespace :rabbit do
30
30
  # on my machine, the rabbitmq user is not be allowed to access my files.
31
31
  # so we need to put the config file under /tmp
32
32
  config_file = "/tmp/beetle-testing-rabbitmq-#{node_name}"
33
-
34
33
  create_config_file config_file, web_port
35
34
 
35
+ enabled_plugins_file = "/tmp/beetle-testing-rabbitmq-enabled-plugins-#{node_name}"
36
+ create_enabled_plugins_file enabled_plugins_file
37
+
36
38
  puts "starting rabbit #{node_name} on port #{port}, web management port #{web_port}"
37
39
  puts "type ^C a RETURN to abort"
38
40
  sleep 1
39
- exec "sudo #{script} #{node_name} #{port} #{config_file}"
41
+ exec "sudo #{script} #{node_name} #{port} #{config_file} #{enabled_plugins_file}"
40
42
  end
41
43
 
42
44
  def create_config_file(config_file, web_port)
@@ -48,6 +50,12 @@ namespace :rabbit do
48
50
  end
49
51
  end
50
52
 
53
+ def create_enabled_plugins_file(enabled_plugins_file)
54
+ File.open("#{enabled_plugins_file}",'w') do |f|
55
+ f.puts "[rabbitmq_management]."
56
+ end
57
+ end
58
+
51
59
  desc "start rabbit instance 1"
52
60
  task :start1 do
53
61
  start "rabbit1", 5672, 15672
@@ -8,5 +8,5 @@ windows and execute the following commands:
8
8
 
9
9
  rake rabbit:start1
10
10
  rake rabbit:start2
11
- rake redis:start1
12
- rake redis:start2
11
+ rake redis:start:master
12
+ rake redis:start:slave
@@ -23,12 +23,17 @@ module Beetle
23
23
  dead_letter_queue_name = options[:dead_letter_queue_name]
24
24
  policy_options = options.slice(:lazy, :dead_lettering)
25
25
 
26
+ # The order of policy creation is important.
27
+ # We need to create the policy on the dead letter queue first to have the message_ttl setting
28
+ # in place before the first message comes in. Otherwise a message will not get a ttl
29
+ # applied and stay in the dead letter queue forever (or until manually consumed), thus
30
+ # blocking the head of the queue.
31
+ dead_letter_queue_options = policy_options.merge(:routing_key => target_queue, :message_ttl => options[:message_ttl])
32
+ set_queue_policy!(server, dead_letter_queue_name, dead_letter_queue_options)
26
33
  target_queue_options = policy_options.merge(:routing_key => dead_letter_queue_name)
27
34
  set_queue_policy!(server, target_queue, target_queue_options)
28
- remove_obsolete_bindings(server, target_queue, options[:bindings]) if options.has_key?(:bindings)
29
35
 
30
- dead_letter_queue_options = policy_options.merge(:routing_key => target_queue, :message_ttl => options[:message_ttl])
31
- set_queue_policy!(server, dead_letter_queue_name, dead_letter_queue_options)
36
+ remove_obsolete_bindings(server, target_queue, options[:bindings]) if options.has_key?(:bindings)
32
37
  end
33
38
 
34
39
  def set_queue_policy!(server, queue_name, options={})
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "3.3.1"
2
+ VERSION = "3.3.2"
3
3
  end
@@ -14,7 +14,7 @@ export RABBITMQ_NODENAME=$1
14
14
  # combination. See clustering on a single machine guide at <http://www.rab-
15
15
  # bitmq.com/clustering.html#single-machine> for details.
16
16
 
17
- # RABBITMQ_NODE_IP_ADDRESS
17
+ export RABBITMQ_NODE_IP_ADDRESS=localhost
18
18
  # Defaults to 0.0.0.0. This can be changed if you only want to bind to one net-
19
19
  # work interface.
20
20
 
@@ -22,11 +22,9 @@ export RABBITMQ_NODE_PORT=$2
22
22
  # Defaults to 5672.
23
23
 
24
24
  export RABBITMQ_CONFIG_FILE=$3
25
- # RABBITMQ_CLUSTER_CONFIG_FILE
26
- # Defaults to /etc/rabbitmq/rabbitmq_cluster.config. If this file is present it
27
- # is used by the server to auto-configure a RabbitMQ cluster. See the clustering
28
- # guide at <http://www.rabbitmq.com/clustering.html> for details.
25
+ export RABBITMQ_ENABLED_PLUGINS_FILE=$4
29
26
 
30
27
  rabbitmq-server
31
28
 
32
29
  rm -f $RABBITMQ_CONFIG_FILE
30
+ rm -f $RABBITMQ_ENABLED_PLUGINS_FILE
@@ -28,13 +28,15 @@ module Beetle
28
28
  :queue_name => "QUEUE_NAME", :dead_letter_queue_name => "QUEUE_NAME_dead_letter",
29
29
  :message_ttl => 10000
30
30
  }
31
- @queue_properties.expects(:set_queue_policy!).with("server", "QUEUE_NAME",
32
- :lazy => true, :dead_lettering => true,
33
- :routing_key => "QUEUE_NAME_dead_letter")
34
- @queue_properties.expects(:set_queue_policy!).with("server", "QUEUE_NAME_dead_letter",
31
+
32
+ policies = sequence('policies')
33
+ @queue_properties.expects(:set_queue_policy!).in_sequence(policies).with("server", "QUEUE_NAME_dead_letter",
35
34
  :lazy => true, :dead_lettering => true,
36
35
  :routing_key => "QUEUE_NAME",
37
36
  :message_ttl => 10000)
37
+ @queue_properties.expects(:set_queue_policy!).in_sequence(policies).with("server", "QUEUE_NAME",
38
+ :lazy => true, :dead_lettering => true,
39
+ :routing_key => "QUEUE_NAME_dead_letter")
38
40
  @queue_properties.update_queue_properties!(options)
39
41
  end
40
42
 
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.1
4
+ version: 3.3.2
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: 2019-08-07 00:00:00.000000000 Z
15
+ date: 2019-11-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bunny
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
375
  - !ruby/object:Gem::Version
376
376
  version: 1.3.7
377
377
  requirements: []
378
- rubygems_version: 3.0.3
378
+ rubygems_version: 3.0.6
379
379
  signing_key:
380
380
  specification_version: 3
381
381
  summary: High Availability AMQP Messaging with Redundant Queues