rabbitek 0.3.0 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/Gemfile.lock +55 -55
- data/lib/rabbitek/cli.rb +2 -1
- data/lib/rabbitek/loggable.rb +5 -1
- data/lib/rabbitek/server/consumer.rb +4 -0
- data/lib/rabbitek/server/hooks/retry.rb +18 -1
- data/lib/rabbitek/utils/open_tracing.rb +4 -1
- data/lib/rabbitek/version.rb +1 -1
- data/rabbitek.gemspec +7 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a36ba46180d4c5e3c28d3d212ff2174c49ef00618f6d49c7defd49ec0768d5ae
|
4
|
+
data.tar.gz: 25167637efc19c059e73ff8796a19aef890e961ec3c7c891b2b9aba1429d1ef3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d4cfcad4e769c15e556b93ba40e9c779aa16ab739a889bd2ec01728b1c84cae25096a559aaaf687875f792ad43789612903c9c6c3b4e222b5a3ba0d801df68
|
7
|
+
data.tar.gz: 22b95c1863b7d22d66c4b9f2eb02a18c734450ac09b3aa999dd6b5f316fa40e45f7f52b101e8924a1c2f2a1e2b8601ba6830b99c4948659825983927c393f421
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
## v0.3.5
|
2
|
+
|
3
|
+
Bugfix:
|
4
|
+
* Fix OpenTracing support when there is no trace_id incoming with job.
|
5
|
+
|
6
|
+
## v0.3.4
|
7
|
+
|
8
|
+
Improvements:
|
9
|
+
* Logging improvement
|
10
|
+
|
11
|
+
## v0.3.3
|
12
|
+
|
13
|
+
Improvements:
|
14
|
+
* Failure in retry hook will result in additional logging and nacking job with requeue: true
|
15
|
+
|
16
|
+
## v0.3.2
|
17
|
+
|
18
|
+
## v0.3.1
|
19
|
+
|
20
|
+
Bugfix:
|
21
|
+
* Fix sentry integration while logging messages different than exceptions
|
22
|
+
|
1
23
|
## v0.3.0
|
2
24
|
|
3
25
|
Improvements:
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rabbitek (0.3.
|
4
|
+
rabbitek (0.3.4)
|
5
5
|
activesupport (> 3.0)
|
6
6
|
bunny (~> 2.11.0)
|
7
7
|
oj (~> 3.6)
|
@@ -11,43 +11,43 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
actioncable (5.2.
|
15
|
-
actionpack (= 5.2.
|
14
|
+
actioncable (5.2.4.1)
|
15
|
+
actionpack (= 5.2.4.1)
|
16
16
|
nio4r (~> 2.0)
|
17
17
|
websocket-driver (>= 0.6.1)
|
18
|
-
actionmailer (5.2.
|
19
|
-
actionpack (= 5.2.
|
20
|
-
actionview (= 5.2.
|
21
|
-
activejob (= 5.2.
|
18
|
+
actionmailer (5.2.4.1)
|
19
|
+
actionpack (= 5.2.4.1)
|
20
|
+
actionview (= 5.2.4.1)
|
21
|
+
activejob (= 5.2.4.1)
|
22
22
|
mail (~> 2.5, >= 2.5.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
|
-
actionpack (5.2.
|
25
|
-
actionview (= 5.2.
|
26
|
-
activesupport (= 5.2.
|
27
|
-
rack (~> 2.0)
|
24
|
+
actionpack (5.2.4.1)
|
25
|
+
actionview (= 5.2.4.1)
|
26
|
+
activesupport (= 5.2.4.1)
|
27
|
+
rack (~> 2.0, >= 2.0.8)
|
28
28
|
rack-test (>= 0.6.3)
|
29
29
|
rails-dom-testing (~> 2.0)
|
30
30
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
31
|
-
actionview (5.2.
|
32
|
-
activesupport (= 5.2.
|
31
|
+
actionview (5.2.4.1)
|
32
|
+
activesupport (= 5.2.4.1)
|
33
33
|
builder (~> 3.1)
|
34
34
|
erubi (~> 1.4)
|
35
35
|
rails-dom-testing (~> 2.0)
|
36
36
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
37
|
-
activejob (5.2.
|
38
|
-
activesupport (= 5.2.
|
37
|
+
activejob (5.2.4.1)
|
38
|
+
activesupport (= 5.2.4.1)
|
39
39
|
globalid (>= 0.3.6)
|
40
|
-
activemodel (5.2.
|
41
|
-
activesupport (= 5.2.
|
42
|
-
activerecord (5.2.
|
43
|
-
activemodel (= 5.2.
|
44
|
-
activesupport (= 5.2.
|
40
|
+
activemodel (5.2.4.1)
|
41
|
+
activesupport (= 5.2.4.1)
|
42
|
+
activerecord (5.2.4.1)
|
43
|
+
activemodel (= 5.2.4.1)
|
44
|
+
activesupport (= 5.2.4.1)
|
45
45
|
arel (>= 9.0)
|
46
|
-
activestorage (5.2.
|
47
|
-
actionpack (= 5.2.
|
48
|
-
activerecord (= 5.2.
|
46
|
+
activestorage (5.2.4.1)
|
47
|
+
actionpack (= 5.2.4.1)
|
48
|
+
activerecord (= 5.2.4.1)
|
49
49
|
marcel (~> 0.3.1)
|
50
|
-
activesupport (5.2.
|
50
|
+
activesupport (5.2.4.1)
|
51
51
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
52
52
|
i18n (>= 0.7, < 2)
|
53
53
|
minitest (~> 5.1)
|
@@ -55,20 +55,20 @@ GEM
|
|
55
55
|
amq-protocol (2.3.0)
|
56
56
|
arel (9.0.0)
|
57
57
|
ast (2.4.0)
|
58
|
-
builder (3.2.
|
58
|
+
builder (3.2.4)
|
59
59
|
bunny (2.11.0)
|
60
60
|
amq-protocol (~> 2.3.0)
|
61
61
|
coderay (1.1.2)
|
62
|
-
concurrent-ruby (1.1.
|
63
|
-
crass (1.0.
|
62
|
+
concurrent-ruby (1.1.5)
|
63
|
+
crass (1.0.6)
|
64
64
|
diff-lcs (1.3)
|
65
|
-
erubi (1.
|
65
|
+
erubi (1.9.0)
|
66
66
|
globalid (0.4.2)
|
67
67
|
activesupport (>= 4.2.0)
|
68
|
-
i18n (1.
|
68
|
+
i18n (1.8.2)
|
69
69
|
concurrent-ruby (~> 1.0)
|
70
70
|
jaro_winkler (1.5.1)
|
71
|
-
loofah (2.
|
71
|
+
loofah (2.4.0)
|
72
72
|
crass (~> 1.0.2)
|
73
73
|
nokogiri (>= 1.5.9)
|
74
74
|
mail (2.7.1)
|
@@ -79,11 +79,11 @@ GEM
|
|
79
79
|
mimemagic (0.3.3)
|
80
80
|
mini_mime (1.0.2)
|
81
81
|
mini_portile2 (2.4.0)
|
82
|
-
minitest (5.
|
83
|
-
nio4r (2.
|
84
|
-
nokogiri (1.10.
|
82
|
+
minitest (5.14.0)
|
83
|
+
nio4r (2.5.2)
|
84
|
+
nokogiri (1.10.7)
|
85
85
|
mini_portile2 (~> 2.4.0)
|
86
|
-
oj (3.
|
86
|
+
oj (3.10.1)
|
87
87
|
opentracing (0.5.0)
|
88
88
|
parallel (1.12.1)
|
89
89
|
parser (2.5.1.2)
|
@@ -92,30 +92,30 @@ GEM
|
|
92
92
|
pry (0.12.2)
|
93
93
|
coderay (~> 1.1.0)
|
94
94
|
method_source (~> 0.9.0)
|
95
|
-
rack (2.
|
95
|
+
rack (2.1.1)
|
96
96
|
rack-test (1.1.0)
|
97
97
|
rack (>= 1.0, < 3)
|
98
|
-
rails (5.2.
|
99
|
-
actioncable (= 5.2.
|
100
|
-
actionmailer (= 5.2.
|
101
|
-
actionpack (= 5.2.
|
102
|
-
actionview (= 5.2.
|
103
|
-
activejob (= 5.2.
|
104
|
-
activemodel (= 5.2.
|
105
|
-
activerecord (= 5.2.
|
106
|
-
activestorage (= 5.2.
|
107
|
-
activesupport (= 5.2.
|
98
|
+
rails (5.2.4.1)
|
99
|
+
actioncable (= 5.2.4.1)
|
100
|
+
actionmailer (= 5.2.4.1)
|
101
|
+
actionpack (= 5.2.4.1)
|
102
|
+
actionview (= 5.2.4.1)
|
103
|
+
activejob (= 5.2.4.1)
|
104
|
+
activemodel (= 5.2.4.1)
|
105
|
+
activerecord (= 5.2.4.1)
|
106
|
+
activestorage (= 5.2.4.1)
|
107
|
+
activesupport (= 5.2.4.1)
|
108
108
|
bundler (>= 1.3.0)
|
109
|
-
railties (= 5.2.
|
109
|
+
railties (= 5.2.4.1)
|
110
110
|
sprockets-rails (>= 2.0.0)
|
111
111
|
rails-dom-testing (2.0.3)
|
112
112
|
activesupport (>= 4.2.0)
|
113
113
|
nokogiri (>= 1.6)
|
114
|
-
rails-html-sanitizer (1.0
|
115
|
-
loofah (~> 2.
|
116
|
-
railties (5.2.
|
117
|
-
actionpack (= 5.2.
|
118
|
-
activesupport (= 5.2.
|
114
|
+
rails-html-sanitizer (1.3.0)
|
115
|
+
loofah (~> 2.3)
|
116
|
+
railties (5.2.4.1)
|
117
|
+
actionpack (= 5.2.4.1)
|
118
|
+
activesupport (= 5.2.4.1)
|
119
119
|
method_source
|
120
120
|
rake (>= 0.8.7)
|
121
121
|
thor (>= 0.19.0, < 2.0)
|
@@ -144,16 +144,16 @@ GEM
|
|
144
144
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
145
145
|
ruby-progressbar (1.10.0)
|
146
146
|
slop (4.7.0)
|
147
|
-
sprockets (
|
147
|
+
sprockets (4.0.0)
|
148
148
|
concurrent-ruby (~> 1.0)
|
149
149
|
rack (> 1, < 3)
|
150
150
|
sprockets-rails (3.2.1)
|
151
151
|
actionpack (>= 4.0)
|
152
152
|
activesupport (>= 4.0)
|
153
153
|
sprockets (>= 3.0.0)
|
154
|
-
thor (0.
|
154
|
+
thor (1.0.1)
|
155
155
|
thread_safe (0.3.6)
|
156
|
-
tzinfo (1.2.
|
156
|
+
tzinfo (1.2.6)
|
157
157
|
thread_safe (~> 0.1)
|
158
158
|
unicode-display_width (1.4.0)
|
159
159
|
websocket-driver (0.7.1)
|
@@ -173,4 +173,4 @@ DEPENDENCIES
|
|
173
173
|
rubocop (~> 0.58.0)
|
174
174
|
|
175
175
|
BUNDLED WITH
|
176
|
-
2.0.
|
176
|
+
2.0.2
|
data/lib/rabbitek/cli.rb
CHANGED
@@ -77,7 +77,8 @@ module Rabbitek
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def boot_consumers
|
80
|
-
(1..configuration[:threads]).each_with_object([]) do |
|
80
|
+
(1..configuration[:threads]).each_with_object([]) do |i, arr|
|
81
|
+
debug "Booting thread ##{i}"
|
81
82
|
arr << Starter.new(Rabbitek.bunny_connection, configuration).start
|
82
83
|
end
|
83
84
|
end
|
data/lib/rabbitek/loggable.rb
CHANGED
@@ -15,7 +15,7 @@ module Rabbitek
|
|
15
15
|
def error(msg)
|
16
16
|
log_msg(:error, msg)
|
17
17
|
NewRelic::Agent.notice_error(msg) if Rabbitek.config.enable_newrelic && Object.const_defined?('NewRelic')
|
18
|
-
|
18
|
+
raven_capture_error(msg) if Rabbitek.config.enable_sentry && Object.const_defined?('Raven')
|
19
19
|
true
|
20
20
|
end
|
21
21
|
|
@@ -46,5 +46,9 @@ module Rabbitek
|
|
46
46
|
def class_name(msg)
|
47
47
|
msg.is_a?(Hash) && msg[:class_name] ? msg.delete(:class_name) : self.class.name
|
48
48
|
end
|
49
|
+
|
50
|
+
def raven_capture_error(msg)
|
51
|
+
msg.is_a?(Exception) ? Raven.capture_exception(msg) : Raven.capture_message(msg.to_s)
|
52
|
+
end
|
49
53
|
end
|
50
54
|
end
|
@@ -8,12 +8,29 @@ module Rabbitek
|
|
8
8
|
##
|
9
9
|
# Hook to retry failed jobs
|
10
10
|
class Retry < Rabbitek::ServerHook
|
11
|
+
include Loggable
|
12
|
+
|
11
13
|
def call(consumer, message)
|
12
14
|
super
|
13
15
|
rescue StandardError
|
14
|
-
|
16
|
+
retry_message(consumer, message) unless consumer.batch_size
|
15
17
|
raise
|
16
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def retry_message(consumer, message)
|
23
|
+
Retryer.call(consumer, message)
|
24
|
+
rescue StandardError => e
|
25
|
+
error(
|
26
|
+
message: 'Critical error while retrying. Nacking and requeueing message',
|
27
|
+
consumer: message.delivery_info.routing_key,
|
28
|
+
jid: consumer.jid,
|
29
|
+
error: e.to_s
|
30
|
+
)
|
31
|
+
|
32
|
+
consumer.nack!(message.delivery_info)
|
33
|
+
end
|
17
34
|
end
|
18
35
|
end
|
19
36
|
end
|
@@ -55,7 +55,10 @@ module Rabbitek
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def server_references(message_properties)
|
58
|
-
|
58
|
+
ctx = extract(message_properties)
|
59
|
+
return unless ctx
|
60
|
+
|
61
|
+
::OpenTracing::Reference.follows_from(ctx)
|
59
62
|
end
|
60
63
|
|
61
64
|
def extract(message_properties)
|
data/lib/rabbitek/version.rb
CHANGED
data/rabbitek.gemspec
CHANGED
@@ -14,9 +14,15 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.description = 'High performance background job processing'
|
15
15
|
spec.homepage = 'http://boostcom.no'
|
16
16
|
|
17
|
+
spec.license = 'MIT'
|
18
|
+
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/Boostcom/rabbitek'
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/Boostcom/rabbitek/blob/master/CHANGELOG.md'
|
21
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/Boostcom/rabbitek/issues'
|
22
|
+
|
17
23
|
# Specify which files should be added to the gem when it is released.
|
18
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
-
spec.files
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
26
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
27
|
end
|
22
28
|
spec.bindir = 'exe'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbitek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boostcom
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -215,8 +215,12 @@ files:
|
|
215
215
|
- lib/rabbitek/version.rb
|
216
216
|
- rabbitek.gemspec
|
217
217
|
homepage: http://boostcom.no
|
218
|
-
licenses:
|
219
|
-
|
218
|
+
licenses:
|
219
|
+
- MIT
|
220
|
+
metadata:
|
221
|
+
source_code_uri: https://github.com/Boostcom/rabbitek
|
222
|
+
changelog_uri: https://github.com/Boostcom/rabbitek/blob/master/CHANGELOG.md
|
223
|
+
bug_tracker_uri: https://github.com/Boostcom/rabbitek/issues
|
220
224
|
post_install_message:
|
221
225
|
rdoc_options: []
|
222
226
|
require_paths:
|