emque-consuming 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -3
- data/CHANGELOG.md +1 -0
- data/emque-consuming.gemspec +2 -2
- data/lib/emque/consuming/consumer.rb +25 -0
- data/lib/emque/consuming/consumer/common.rb +0 -28
- data/lib/emque/consuming/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a7cb13ff862f06e20c37a2ab24e63d27bae8a7bc
|
4
|
+
data.tar.gz: 20d04ac78c5f6898997b777a13fc41dfedf7e52d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 409d9bb814d8c61640b9ae466a60c2b1cf87e59373430cb14e566060420171e6ec68b4fdfe9bd723d4b6c52957151007670b88e4717db1791c0eb62916cb91ef
|
7
|
+
data.tar.gz: b253f6405bfc98ad0ce91cd9a93767bd10d6033a8203ff30b56569c83398c3b943df7a1ed5c088bcc4c283d1853a76ee65b90a3a5415fc18b27f1b8f8e774012
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Emque Consuming CHANGELOG
|
2
2
|
|
3
|
+
- [Update pipe-ruby to remove error handling](https://github.com/emque/emque-consuming/pull/78) 1.7.0
|
3
4
|
- [Fixes bug with Bunny 2.12 failing when exchange names are symbols](https://github.com/emque/emque-consuming/pull/77) 1.6.1
|
4
5
|
- [Re-enable pipe-ruby `raise_on_error` option to fix automatic retries directing messages to the error queue](https://github.com/emque/emque-consuming/pull/75) 1.6.0
|
5
6
|
- [Update the puma gem to allow v3](https://github.com/emque/emque-consuming/pull/72) 1.5.0
|
data/emque-consuming.gemspec
CHANGED
@@ -6,7 +6,7 @@ require "emque/consuming/version"
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "emque-consuming"
|
8
8
|
spec.version = Emque::Consuming::VERSION
|
9
|
-
spec.authors = ["Ryan Williams", "Dan Matthews"]
|
9
|
+
spec.authors = ["Ryan Williams", "Dan Matthews", "Paul Hanyzewski"]
|
10
10
|
spec.email = ["oss@teamsnap.com"]
|
11
11
|
spec.summary = %q{Microservices framework for Ruby}
|
12
12
|
spec.summary = %q{Microservices framework for Ruby}
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "oj", "~> 2.18.5"
|
25
25
|
spec.add_dependency "virtus", "~> 1.0"
|
26
26
|
spec.add_dependency "puma", "~> 3.12"
|
27
|
-
spec.add_dependency "pipe-ruby", "~>
|
27
|
+
spec.add_dependency "pipe-ruby", "~> 1.0"
|
28
28
|
spec.add_dependency "inflecto", "~> 0.0.2"
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.7"
|
@@ -11,6 +11,9 @@ module Emque
|
|
11
11
|
|
12
12
|
def process(message)
|
13
13
|
pipe(message, :through => [:parse, :route])
|
14
|
+
rescue => e
|
15
|
+
handle_error(e, message)
|
16
|
+
raise
|
14
17
|
end
|
15
18
|
|
16
19
|
private
|
@@ -29,6 +32,28 @@ module Emque
|
|
29
32
|
message
|
30
33
|
)
|
31
34
|
end
|
35
|
+
|
36
|
+
def handle_error(e, subject)
|
37
|
+
context = {
|
38
|
+
:consumer => self.class.name,
|
39
|
+
:message => {
|
40
|
+
:current => subject.values,
|
41
|
+
:original => subject.original
|
42
|
+
},
|
43
|
+
:topic => subject.topic
|
44
|
+
}
|
45
|
+
|
46
|
+
# log the error by default
|
47
|
+
Emque::Consuming.logger.error("Error consuming message #{e}")
|
48
|
+
Emque::Consuming.logger.error(context)
|
49
|
+
Emque::Consuming.logger.error e.backtrace.join("\n") unless e.backtrace.nil?
|
50
|
+
|
51
|
+
Emque::Consuming.config.error_handlers.each do |handler|
|
52
|
+
handler.call(e, context)
|
53
|
+
end
|
54
|
+
|
55
|
+
Emque::Consuming.application.instance.notice_error(context)
|
56
|
+
end
|
32
57
|
end
|
33
58
|
end
|
34
59
|
end
|
@@ -16,7 +16,6 @@ module Emque
|
|
16
16
|
def self.included(descendant)
|
17
17
|
descendant.class_eval do
|
18
18
|
attr_reader :message
|
19
|
-
private :handle_error, :pipe
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
@@ -26,36 +25,9 @@ module Emque
|
|
26
25
|
|
27
26
|
def pipe_config
|
28
27
|
@pipe_config ||= Pipe::Config.new(
|
29
|
-
:error_handlers => [method(:handle_error)],
|
30
|
-
:raise_on_error => true,
|
31
28
|
:stop_on => ->(msg, _, _) { !(msg.respond_to?(:continue?) && msg.continue?) }
|
32
29
|
)
|
33
30
|
end
|
34
|
-
|
35
|
-
def handle_error(e, method:, subject:)
|
36
|
-
context = {
|
37
|
-
:consumer => self.class.name,
|
38
|
-
:message => {
|
39
|
-
:current => subject.values,
|
40
|
-
:original => subject.original
|
41
|
-
},
|
42
|
-
:offset => subject.offset,
|
43
|
-
:partition => subject.partition,
|
44
|
-
:pipe_method => method,
|
45
|
-
:topic => subject.topic
|
46
|
-
}
|
47
|
-
|
48
|
-
# log the error by default
|
49
|
-
Emque::Consuming.logger.error("Error consuming message #{e}")
|
50
|
-
Emque::Consuming.logger.error(context)
|
51
|
-
Emque::Consuming.logger.error e.backtrace.join("\n") unless e.backtrace.nil?
|
52
|
-
|
53
|
-
Emque::Consuming.config.error_handlers.each do |handler|
|
54
|
-
handler.call(e, context)
|
55
|
-
end
|
56
|
-
|
57
|
-
Emque::Consuming.application.instance.notice_error(context)
|
58
|
-
end
|
59
31
|
end
|
60
32
|
end
|
61
33
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emque-consuming
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Williams
|
8
8
|
- Dan Matthews
|
9
|
+
- Paul Hanyzewski
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: celluloid
|
@@ -87,14 +88,14 @@ dependencies:
|
|
87
88
|
requirements:
|
88
89
|
- - "~>"
|
89
90
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
91
|
+
version: '1.0'
|
91
92
|
type: :runtime
|
92
93
|
prerelease: false
|
93
94
|
version_requirements: !ruby/object:Gem::Requirement
|
94
95
|
requirements:
|
95
96
|
- - "~>"
|
96
97
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
98
|
+
version: '1.0'
|
98
99
|
- !ruby/object:Gem::Dependency
|
99
100
|
name: inflecto
|
100
101
|
requirement: !ruby/object:Gem::Requirement
|
@@ -289,7 +290,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
290
|
- !ruby/object:Gem::Version
|
290
291
|
version: '0'
|
291
292
|
requirements: []
|
292
|
-
|
293
|
+
rubyforge_project:
|
294
|
+
rubygems_version: 2.5.2.3
|
293
295
|
signing_key:
|
294
296
|
specification_version: 4
|
295
297
|
summary: Microservices framework for Ruby
|