sneakers_handlers 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +18 -0
- data/lib/sneakers_handlers/exponential_backoff_handler.rb +8 -5
- data/lib/sneakers_handlers/version.rb +1 -1
- data/sneakers_handlers.gemspec +6 -4
- metadata +24 -24
- data/circle.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ef89084a48b99025b4e7795eb8d841c35314954c6a4c823afbaeb3feebd75c69
|
4
|
+
data.tar.gz: bfc57518d44975282b56bd0c3fd6cb189f9c9ea7ec090f249d80c5532f66d409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 889f0647e17dfb9f36d13604ef3a1639c192100afbb8b05590c7cd4fcc805605f4f851e9024ffb36645fe2f29d0a328a176d1629c2d491e344eef5566630f045
|
7
|
+
data.tar.gz: 0addbe6110b507be793dcfa9be93c773a57ac0d89d77f57172e410974e5ad8348dbd616b6b3d607f3ef5baf4cfa5390142d162aaa8de5327777b909af2bf2310
|
@@ -0,0 +1,18 @@
|
|
1
|
+
version: 2
|
2
|
+
|
3
|
+
jobs:
|
4
|
+
specs:
|
5
|
+
working_directory: ~/app
|
6
|
+
docker:
|
7
|
+
- image: circleci/ruby:2.6.3-node-browsers
|
8
|
+
- image: alphasights/rabbitmq:3.7
|
9
|
+
steps:
|
10
|
+
- checkout
|
11
|
+
- run: bundle
|
12
|
+
- run: bundle exec rake test
|
13
|
+
|
14
|
+
workflows:
|
15
|
+
version: 2
|
16
|
+
ci_workflow:
|
17
|
+
jobs:
|
18
|
+
- specs
|
@@ -69,7 +69,7 @@ module SneakersHandlers
|
|
69
69
|
if attempt_number < max_retries
|
70
70
|
delay = backoff_function.call(attempt_number)
|
71
71
|
|
72
|
-
log("msg=retrying, delay=#{delay}, count=#{attempt_number}, properties=#{properties}, reason=#{reason}")
|
72
|
+
log(message: "msg=retrying, delay=#{delay}, count=#{attempt_number}, properties=#{properties}, reason=#{reason}")
|
73
73
|
|
74
74
|
routing_key = "#{queue.name}.#{delay}"
|
75
75
|
|
@@ -78,11 +78,14 @@ module SneakersHandlers
|
|
78
78
|
|
79
79
|
primary_exchange.publish(message, routing_key: routing_key, headers: headers)
|
80
80
|
else
|
81
|
-
log("msg=erroring, count=#{attempt_number}, properties=#{properties}")
|
81
|
+
log(message: "msg=erroring, count=#{attempt_number}, properties=#{properties}")
|
82
82
|
error_exchange.publish(message, routing_key: dlx_routing_key, headers: headers)
|
83
83
|
end
|
84
84
|
|
85
85
|
acknowledge(delivery_info, properties, message)
|
86
|
+
rescue => e
|
87
|
+
log(level: :error, message: "msg=unexpected_handler_error, error='#{e.message}'")
|
88
|
+
raise e
|
86
89
|
end
|
87
90
|
|
88
91
|
# This is the header used by the `rabbitmq-delayed-message-exchange`
|
@@ -105,14 +108,14 @@ module SneakersHandlers
|
|
105
108
|
end
|
106
109
|
end
|
107
110
|
|
108
|
-
def log(message)
|
109
|
-
Sneakers.logger.
|
111
|
+
def log(message:, level: :info)
|
112
|
+
Sneakers.logger.send(level) do
|
110
113
|
"[#{self.class}] #{message}"
|
111
114
|
end
|
112
115
|
end
|
113
116
|
|
114
117
|
def create_exchange(name, type = "topic")
|
115
|
-
log("creating exchange=#{name}")
|
118
|
+
log(message: "creating exchange=#{name}")
|
116
119
|
|
117
120
|
channel.exchange(name, type: type, durable: options[:exchange_options][:durable])
|
118
121
|
end
|
data/sneakers_handlers.gemspec
CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = SneakersHandlers::VERSION
|
9
9
|
spec.authors = ["John Bohn, Abe Petrillo, Brian Storti"]
|
10
10
|
spec.email = ["abe.petrillo@gmail.com"]
|
11
|
+
spec.licenses = ['MIT']
|
11
12
|
|
12
13
|
spec.summary = %q{Adds Handlers to use with Sneakers}
|
13
14
|
spec.description = %q{Adds handlers to support retry and custom shoveling}
|
@@ -19,11 +20,12 @@ Gem::Specification.new do |spec|
|
|
19
20
|
spec.bindir = "exe"
|
20
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
22
|
spec.require_paths = ["lib"]
|
23
|
+
spec.required_ruby_version = "~> 2.0"
|
22
24
|
|
23
|
-
spec.add_dependency "sneakers"
|
24
|
-
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_dependency "sneakers", "~> 2.0"
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
25
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
28
|
spec.add_development_dependency "minitest", "~> 5.0"
|
27
|
-
spec.add_development_dependency "pry-byebug"
|
28
|
-
spec.add_development_dependency "minitest-reporters"
|
29
|
+
spec.add_development_dependency "pry-byebug", "~> 3.5"
|
30
|
+
spec.add_development_dependency "minitest-reporters", "~> 1.0"
|
29
31
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sneakers_handlers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bohn, Abe Petrillo, Brian Storti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sneakers
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.9'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1.9'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,30 +70,30 @@ dependencies:
|
|
70
70
|
name: pry-byebug
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.5'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.5'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest-reporters
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '1.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '1.0'
|
97
97
|
description: Adds handlers to support retry and custom shoveling
|
98
98
|
email:
|
99
99
|
- abe.petrillo@gmail.com
|
@@ -101,6 +101,7 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- ".circleci/config.yml"
|
104
105
|
- ".env-example"
|
105
106
|
- ".gitignore"
|
106
107
|
- Gemfile
|
@@ -110,7 +111,6 @@ files:
|
|
110
111
|
- bin/console
|
111
112
|
- bin/rake
|
112
113
|
- bin/setup
|
113
|
-
- circle.yml
|
114
114
|
- docs/backoff.png
|
115
115
|
- lib/sneakers_handlers.rb
|
116
116
|
- lib/sneakers_handlers/dead_letter_handler.rb
|
@@ -119,7 +119,8 @@ files:
|
|
119
119
|
- lib/sneakers_handlers/version.rb
|
120
120
|
- sneakers_handlers.gemspec
|
121
121
|
homepage: https://github.com/alphasights/sneakers_handlers
|
122
|
-
licenses:
|
122
|
+
licenses:
|
123
|
+
- MIT
|
123
124
|
metadata:
|
124
125
|
allowed_push_host: https://rubygems.org
|
125
126
|
post_install_message:
|
@@ -128,17 +129,16 @@ require_paths:
|
|
128
129
|
- lib
|
129
130
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
131
|
requirements:
|
131
|
-
- - "
|
132
|
+
- - "~>"
|
132
133
|
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
134
|
+
version: '2.0'
|
134
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
136
|
requirements:
|
136
137
|
- - ">="
|
137
138
|
- !ruby/object:Gem::Version
|
138
139
|
version: '0'
|
139
140
|
requirements: []
|
140
|
-
|
141
|
-
rubygems_version: 2.6.13
|
141
|
+
rubygems_version: 3.0.1
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Adds Handlers to use with Sneakers
|