beetle 3.3.2 → 3.3.3

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: 7182d9c5ef7c4970ae13bbabe91b1fcdea45991fa85a4abb3f53cfca22597a88
4
- data.tar.gz: 857b842d7c2b81ee95d374ef78d02fbe15bfbae585d6afa4988e848f1c31d164
3
+ metadata.gz: 4aceed6177b4f2b7e4d02cb52910ebec0ea0f0fbd90fbf552bc9ddaa49a833bd
4
+ data.tar.gz: 16a61b5e7384e215a3af25a06c65b43707c25bfc1a46dfd9ee1f4da1c3365acd
5
5
  SHA512:
6
- metadata.gz: 57fa3450b087d9221224e8d6700074f2ba00aef9a39cd77ffbb81709f72fa115c360f89b56741e3ece716e2d7300c5d3023ca2b4db16fd59135ac99c7dc881e3
7
- data.tar.gz: d6acfd5c143adfb4ec75320265a1a29f97916344d2b041d5e5ee6cb023dac514b30e357a06b4ef9258847440b8ba6bfd8b938ab0df3400b3c696462fef7600ba
6
+ metadata.gz: a9c7acebd383b549f6c6cfca1c0aa19559487db55a3095c89da3e24f3696a6a7d8a77dcb9e05127cc997d165130f766fec22bd7d0aa8de49855c3414b590603b
7
+ data.tar.gz: 348913abe61bf69f20046b050b17fdc510074016ff3e39c0fe4562bde640b076329c326980fe7fd0ee32428e1748e162f653115da62d4c2e7406219c9bac9d97
@@ -55,8 +55,8 @@ windows and execute the following commands:
55
55
 
56
56
  rake rabbit:start1
57
57
  rake rabbit:start2
58
- rake redis:start1
59
- rake redis:start2
58
+ rake redis:start:master
59
+ rake redis:start:slave
60
60
 
61
61
  == Prerequisites
62
62
 
@@ -87,8 +87,6 @@ should suffice.
87
87
  == Gem Dependencies
88
88
 
89
89
  At runtime, Beetle will use
90
- * {uuid4r}[http://github.com/skaes/uuid4r]
91
- (which needs ossp-uuid)
92
90
  * {bunny}[http://github.com/ruby-amqp/bunny]
93
91
  * {redis}[http://github.com/redis/redis-rb]
94
92
  * {amqp}[http://github.com/ruby-amqp/amqp]
@@ -106,6 +104,8 @@ For tests, you'll need
106
104
  * {activerecord}[https://github.com/rails/rails/tree/master/activerecord]
107
105
  * {mysql2}[https://github.com/brianmario/mysql2/]
108
106
 
107
+ Dependencies are managed by bundler.
108
+
109
109
  == Authors
110
110
 
111
111
  {Stefan Kaes}[http://github.com/skaes],
@@ -133,22 +133,48 @@ distribution.
133
133
  Don't increase the gem version in your pull requests. It will be done after merging the request,
134
134
  to allow merging of pull requests in a flexible order.
135
135
 
136
- == Running the tests
136
+ == Compiling beetle and running tests
137
+
138
+ In order to execute the unit tests, you need Ruby, a running rabbitmq server, a running
139
+ redis-server, a running mysql server and a runnning consul server.
140
+
141
+ In addition, beetle ships with a cucumber feature to test the automatic redis failover as
142
+ an integration test. For this you need a recent Go installation in order to compile the
143
+ beetle go binary. Just invoke `make` in the top level directory.
144
+
145
+ There are two ways to start the required test dependencies: using `docker-compose` or
146
+ starting the services manually.
147
+
148
+ === Testing with docker-compose
149
+
150
+ Open a separate terminal window and run
151
+
152
+ docker-compose pull
153
+
154
+ followed by
137
155
 
138
- Beetle ships with a cucumber feature to test the automatic redis failover
139
- as an integration test.
156
+ docker-compose up
140
157
 
141
- To run it, you have to start a RabbitMQ server and a consul
142
- development mode.
158
+ This will start mysql, two redis servers, two RabbitMQ instances and a single consul
159
+ development node.
143
160
 
144
- The top level Rakefile comes with targets to start several RabbitMQ
145
- instances locally. Make sure the corresponding binaries are in your
146
- search path. Open two shell windows and execute the following command:
161
+ Note: make sure to wait until all services are properly started.
162
+
163
+
164
+ == Tesing with locally installed services
165
+
166
+ The top level Rakefile comes with targets to start several RabbitMQ instances locally.
167
+ Make sure the corresponding binaries are in your search path. Open three shell windows and
168
+ execute the following command:
147
169
 
148
170
  rake rabbit:start1
149
171
 
150
172
  and
151
173
 
174
+ rake redis:start:master
175
+
176
+ as well as
177
+
152
178
  rake consul:start
153
179
 
154
180
  Then you can run the cucumber feature by running:
@@ -159,9 +185,8 @@ or
159
185
 
160
186
  rake cucumber
161
187
 
162
-
163
- Note: Cucumber will automatically run after the unit test when you run rake.
164
-
188
+ Note: Cucumber will automatically run after the unit tests when you run `rake` without
189
+ arguments.
165
190
 
166
191
 
167
192
  == How to release a new gem version
@@ -1,5 +1,8 @@
1
1
  = Release Notes
2
2
 
3
+ == Version 3.3.3
4
+ * Track publishing policy options metrics.
5
+
3
6
  == Version 3.3.2
4
7
  * Changed order of queue policy application to avoid ahead of line blocking in dead letter
5
8
  queues.
data/Rakefile CHANGED
@@ -58,11 +58,11 @@ namespace :rabbit do
58
58
 
59
59
  desc "start rabbit instance 1"
60
60
  task :start1 do
61
- start "rabbit1", 5672, 15672
61
+ start "rabbit1@localhost", 5672, 15672
62
62
  end
63
63
  desc "start rabbit instance 2"
64
64
  task :start2 do
65
- start "rabbit2", 5673, 15673
65
+ start "rabbit2@localhost", 5673, 15673
66
66
  end
67
67
  desc "reset rabbit instances (deletes all data!)"
68
68
  task :reset do
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_development_dependency "minitest", "~> 5.1"
39
39
  s.add_development_dependency "mocha", "~> 1.3.0"
40
40
  s.add_development_dependency "mysql2", "~> 0.4.4"
41
- s.add_development_dependency "rake", "~> 11.2"
41
+ s.add_development_dependency "rake", "~> 13.0"
42
42
  s.add_development_dependency "rdoc", "~> 4.0"
43
43
  s.add_development_dependency "simplecov", "~> 0.15"
44
44
  s.add_development_dependency "webmock", "~> 3.0"
@@ -99,10 +99,12 @@ module Beetle
99
99
  payload = options.merge(:server => @server)
100
100
  logger.debug("Beetle: publishing policy options on #{@server}: #{payload.inspect}")
101
101
  # make sure to declare the queue, so the message does not get lost
102
- queue(@client.config.beetle_policy_updates_queue_name)
103
- data = payload.to_json
104
- opts = Message.publishing_options(:key => @client.config.beetle_policy_updates_routing_key, :persistent => true, :redundant => false)
105
- exchange(@client.config.beetle_policy_exchange_name).publish(data, opts)
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)
107
+ end
106
108
  end
107
109
 
108
110
  end
@@ -1,3 +1,3 @@
1
1
  module Beetle
2
- VERSION = "3.3.2"
2
+ VERSION = "3.3.3"
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
- export RABBITMQ_NODE_IP_ADDRESS=localhost
17
+ export RABBITMQ_NODE_IP_ADDRESS=127.0.0.1
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
 
@@ -116,6 +116,7 @@ module Beetle
116
116
  class KeyManagementTest < Minitest::Test
117
117
  def setup
118
118
  @config = Configuration.new
119
+ @config.redis_server = Beetle.config.redis_server
119
120
  @store = DeduplicationStore.new(@config)
120
121
  @store.flushdb
121
122
  @null_handler = Handler.create(lambda {|*args|})
@@ -339,6 +340,7 @@ module Beetle
339
340
  class SimpleMessageTest < Minitest::Test
340
341
  def setup
341
342
  @config = Configuration.new
343
+ @config.redis_server = Beetle.config.redis_server
342
344
  @store = DeduplicationStore.new(@config)
343
345
  @store.flushdb
344
346
  end
@@ -765,7 +767,7 @@ module Beetle
765
767
  username: "root",
766
768
  encoding: "utf8",
767
769
  host: ENV['MYSQL_HOST'] || "127.0.0.1",
768
- port: ENV['MYSQL_PORT'] || 3306
770
+ port: (ENV['MYSQL_PORT'] || 3306).to_i
769
771
  )
770
772
  end
771
773
 
@@ -27,9 +27,13 @@ end
27
27
  I18n.enforce_available_locales = false
28
28
 
29
29
  Beetle.config.logger = Logger.new(File.dirname(__FILE__) + '/../test.log')
30
- Beetle.config.redis_server = "localhost:6379"
31
- Beetle.config.redis_servers = "localhost:6379,localhost:6380"
32
-
30
+ if `docker inspect beetle-redis-master -f '{{.State.Status}}'`.chomp == "running"
31
+ Beetle.config.redis_server = "localhost:6370"
32
+ Beetle.config.redis_servers = "localhost:6370,localhost:6380"
33
+ else
34
+ Beetle.config.redis_server = "localhost:6379"
35
+ Beetle.config.redis_servers = "localhost:6379,localhost:6380"
36
+ end
33
37
 
34
38
  def header_with_params(opts = {})
35
39
  beetle_headers = Beetle::Message.publishing_options(opts)
@@ -46,3 +50,7 @@ def redis_stub(name, opts = {})
46
50
  opts = {'host' => default_host, 'port' => default_port, 'server' => "#{default_host}:#{default_port}"}.update(opts)
47
51
  stub(name, opts)
48
52
  end
53
+
54
+ if `docker inspect beetle-mysql -f '{{.State.Status}}'`.chomp == "running"
55
+ ENV['MYSQL_PORT'] = '6612'
56
+ 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.2
4
+ version: 3.3.3
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-11-22 00:00:00.000000000 Z
15
+ date: 2020-04-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bunny
@@ -216,14 +216,14 @@ dependencies:
216
216
  requirements:
217
217
  - - "~>"
218
218
  - !ruby/object:Gem::Version
219
- version: '11.2'
219
+ version: '13.0'
220
220
  type: :development
221
221
  prerelease: false
222
222
  version_requirements: !ruby/object:Gem::Requirement
223
223
  requirements:
224
224
  - - "~>"
225
225
  - !ruby/object:Gem::Version
226
- version: '11.2'
226
+ version: '13.0'
227
227
  - !ruby/object:Gem::Dependency
228
228
  name: rdoc
229
229
  requirement: !ruby/object:Gem::Requirement
@@ -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.6
378
+ rubygems_version: 3.0.8
379
379
  signing_key:
380
380
  specification_version: 3
381
381
  summary: High Availability AMQP Messaging with Redundant Queues