deimos-ruby 1.8.0.pre.beta1 → 1.8.0.pre.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/deimos/consume/batch_consumption.rb +2 -0
- data/lib/deimos/consume/message_consumption.rb +1 -0
- data/lib/deimos/version.rb +1 -1
- data/spec/batch_consumer_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c184b8f182ecfa304684f4e8e522e93c43c12fe50b34300326c2e1ef206b6d1
|
4
|
+
data.tar.gz: 5861974e036c92470a4a801bed477e5cebefa679cc9996a5d6f0258eaa484150
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f19a799d333485b6461e2d8cdeaec5643ec6ddf8f6a2ce1725f3c39269cc193cc5b1bc1e81266b6a33af87ec5d09b3ac2f857b48da61c3baded00a98d6935624
|
7
|
+
data.tar.gz: a08f6519a635e76944b3b7c2f08d5369b6f327e60e968391fcd5e09e703e8ed526d35d8e124f91cbff8c885fbf8d620f90e0a99b48e4289868a0c11925b43d51
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
## 1.8.0-beta2 - 2020-07-08
|
11
|
+
|
12
|
+
### Fixes :wrench:
|
13
|
+
- Fix crash with batch consumption due to not having ActiveSupport::Concern
|
14
|
+
|
15
|
+
### Features :star:
|
16
|
+
- Add `first_offset` to the metadata sent via the batch
|
17
|
+
|
10
18
|
## 1.8.0-beta1 - 2020-07-06
|
11
19
|
### Features :star:
|
12
20
|
- Added `ActiveRecordConsumer` batch mode
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -325,7 +325,8 @@ class MyBatchConsumer < Deimos::Consumer
|
|
325
325
|
|
326
326
|
def consume_batch(payloads, metadata)
|
327
327
|
# payloads is an array of schema-decoded hashes.
|
328
|
-
# metadata is a hash that contains information like :keys
|
328
|
+
# metadata is a hash that contains information like :keys, :topic,
|
329
|
+
# and :first_offset.
|
329
330
|
# Keys are automatically decoded and available as an array with
|
330
331
|
# the same cardinality as the payloads. If you need to iterate
|
331
332
|
# over payloads and keys together, you can use something like this:
|
@@ -6,6 +6,7 @@ module Deimos
|
|
6
6
|
# delivery. Payloads are decoded then consumers are invoked with arrays
|
7
7
|
# of messages to be handled at once
|
8
8
|
module BatchConsumption
|
9
|
+
extend ActiveSupport::Concern
|
9
10
|
include Phobos::BatchHandler
|
10
11
|
|
11
12
|
# :nodoc:
|
@@ -17,6 +18,7 @@ module Deimos
|
|
17
18
|
decode_key(message.key)
|
18
19
|
end
|
19
20
|
end
|
21
|
+
metadata[:first_offset] = batch.first&.offset
|
20
22
|
|
21
23
|
payloads = batch.map do |message|
|
22
24
|
message.payload ? self.class.decoder.decode(message.payload) : nil
|
data/lib/deimos/version.rb
CHANGED
data/spec/batch_consumer_spec.rb
CHANGED
@@ -111,6 +111,7 @@ module ConsumerTest
|
|
111
111
|
test_consume_batch('my_batch_consume_topic', batch, keys: keys) do |_received, metadata|
|
112
112
|
# Mock decode_key extracts the value of the first field as the key
|
113
113
|
expect(metadata[:keys]).to eq(%w(foo bar))
|
114
|
+
expect(metadata[:first_offset]).to eq(1)
|
114
115
|
end
|
115
116
|
end
|
116
117
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.0.pre.
|
4
|
+
version: 1.8.0.pre.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro_turf
|