phobos_db_checkpoint 3.2.0 → 3.3.0

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
  SHA1:
3
- metadata.gz: fb0abf033362b2d16951eea469a851873acbc863
4
- data.tar.gz: 6f92192149a9ee9cbf82895c6f13329b4a87b032
3
+ metadata.gz: 58180a350edfdb0adf597bb4851c4673fb465dde
4
+ data.tar.gz: f598d60bce1c73e3a63730d3fce89fe61dedb697
5
5
  SHA512:
6
- metadata.gz: 54b57b7d287df8fa95916abde5284658c2831588db59863166e8b54061067bde199e6338c251387f72434c1535924038db0a14739523904c3d2878112dc7069d
7
- data.tar.gz: 4ec9fda62d8e9e2d74f7ef4db0b94c7e7d983797484d1cafd30911384bae9b1a9c9baa41de76cbe04e2704b1da1c38d201caca61e567e47684d6e765ce959f2f
6
+ metadata.gz: e12c26c2e3d42820ce8ba9278a4952b87f7702a1f58f45d4cba547026479ed8e82948ad8e8d67b01ee010e45737384d641c10f5266eae2e231ea2cb59195197b
7
+ data.tar.gz: 3cd6e4ffa88191fc70eb8fef38808fcc4bb8a86fb37ed7f315372a11988f0ce881d123cc359fcf5b922e844d733a96933ad50b0b9a3b69434b0335e12a03029a
@@ -0,0 +1 @@
1
+ 2.4.1
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## 3.3.0 (2017-10-26)
8
+
9
+ - [enhancement] Bump Phobos version to 1.5.0 to better support Avro. #34
10
+
7
11
  ## 3.2.0 (2017-10-23)
8
12
 
9
13
  - [enhancement] Make pool_size only configurable through configuration files
data/README.md CHANGED
@@ -14,6 +14,7 @@ Phobos DB Checkpoint is a plugin to [Phobos](https://github.com/klarna/phobos) a
14
14
  1. [Usage](#usage)
15
15
  1. [Setup](#setup)
16
16
  1. [Handler](#handler)
17
+ 1. [Payload](#payload)
17
18
  1. [Failures](#failures)
18
19
  1. [Accessing the events](#accessing-the-events)
19
20
  1. [Events API](#events-api)
@@ -121,6 +122,27 @@ If your handler returns anything different than an __ack__ it won't be saved to
121
122
 
122
123
  Note that the `PhobosDBCheckpoint::Handler` will automatically skip already handled events (i.e. duplicate Kafka messages).
123
124
 
125
+ #### <a name="payload"></a> Payload
126
+ PhobosDBCheckpoint assumes that the payload received from Phobos is in a JSON format. This means that if your payload is in any other format, for example Avro binary, you need to convert/decode it to JSON.
127
+
128
+ To achieve this you can override the `#before_consume` method of the handler:
129
+
130
+ ```ruby
131
+ class MyHandler
132
+ include PhobosDBCheckpoint::Handler
133
+
134
+ # <-- setup @avro before
135
+
136
+ def before_consume(payload)
137
+ @avro.decode(payload)
138
+ end
139
+
140
+ def consume(payload, metadata)
141
+ # <-- consume your stuff with the decoded payload
142
+ end
143
+ end
144
+ ```
145
+
124
146
  #### <a name="failures"></a> Failures
125
147
 
126
148
  If your handler fails during the process of consuming the event, the event will be processed again acknowledged or skipped. The default behavior of `Phobos` is to back off but keep retrying the same event forever, in order to guarantee messages are processed in the correct order. However, this blocking process could go on indefinitely, so in order to help you deal with this PhobosDBCheckpoint can (on an opt-in basis) mark them as permanently failed after a configurable number of attempts.
@@ -1,3 +1,3 @@
1
1
  module PhobosDBCheckpoint
2
- VERSION = '3.2.0'
2
+ VERSION = '3.3.0'
3
3
  end
@@ -12,7 +12,8 @@ Gem::Specification.new do |spec|
12
12
  'Sergey Evstifeev',
13
13
  'Thiago R. Colucci',
14
14
  'Martin Svalin',
15
- 'Francisco Juan'
15
+ 'Francisco Juan',
16
+ 'Tommy Gustafsson'
16
17
  ]
17
18
  spec.email = [
18
19
  'ornelas.tulio@gmail.com',
@@ -20,7 +21,8 @@ Gem::Specification.new do |spec|
20
21
  'sergey.evstifeev@gmail.com',
21
22
  'ticolucci@gmail.com',
22
23
  'martin@lite.nu',
23
- 'francisco.juan@gmail.com'
24
+ 'francisco.juan@gmail.com',
25
+ 'tommydgustafsson@gmail.com'
24
26
  ]
25
27
 
26
28
  spec.summary = %q{Phobos DB Checkpoint is a plugin to Phobos and is meant as a drop in replacement to Phobos::Handler}
@@ -56,6 +58,6 @@ Gem::Specification.new do |spec|
56
58
  spec.add_dependency 'thor'
57
59
  spec.add_dependency 'rake'
58
60
  spec.add_dependency 'activerecord', '>= 4.0.0'
59
- spec.add_dependency 'phobos', '>= 1.0.0'
61
+ spec.add_dependency 'phobos', '>= 1.5.0'
60
62
  spec.add_dependency 'sinatra'
61
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phobos_db_checkpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Túlio Ornelas
@@ -10,10 +10,11 @@ authors:
10
10
  - Thiago R. Colucci
11
11
  - Martin Svalin
12
12
  - Francisco Juan
13
+ - Tommy Gustafsson
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2017-10-24 00:00:00.000000000 Z
17
+ date: 2018-05-03 00:00:00.000000000 Z
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
20
  name: bundler
@@ -203,14 +204,14 @@ dependencies:
203
204
  requirements:
204
205
  - - ">="
205
206
  - !ruby/object:Gem::Version
206
- version: 1.0.0
207
+ version: 1.5.0
207
208
  type: :runtime
208
209
  prerelease: false
209
210
  version_requirements: !ruby/object:Gem::Requirement
210
211
  requirements:
211
212
  - - ">="
212
213
  - !ruby/object:Gem::Version
213
- version: 1.0.0
214
+ version: 1.5.0
214
215
  - !ruby/object:Gem::Dependency
215
216
  name: sinatra
216
217
  requirement: !ruby/object:Gem::Requirement
@@ -234,6 +235,7 @@ email:
234
235
  - ticolucci@gmail.com
235
236
  - martin@lite.nu
236
237
  - francisco.juan@gmail.com
238
+ - tommydgustafsson@gmail.com
237
239
  executables:
238
240
  - phobos_db_checkpoint
239
241
  extensions: []
@@ -241,6 +243,7 @@ extra_rdoc_files: []
241
243
  files:
242
244
  - ".gitignore"
243
245
  - ".rspec"
246
+ - ".ruby-version"
244
247
  - CHANGELOG.md
245
248
  - Gemfile
246
249
  - LICENSE.txt
@@ -294,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
297
  version: '0'
295
298
  requirements: []
296
299
  rubyforge_project:
297
- rubygems_version: 2.6.8
300
+ rubygems_version: 2.6.13
298
301
  signing_key:
299
302
  specification_version: 4
300
303
  summary: Phobos DB Checkpoint is a plugin to Phobos and is meant as a drop in replacement