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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82c1b89b49622cb0d47a7a7aa56e076d908785906581f9f0772f09679acd6895
4
- data.tar.gz: eeadf1d1a63db1407a81ef1f993be1b8d421e8e2624b9f42c324a2dad776bd1c
3
+ metadata.gz: 5c184b8f182ecfa304684f4e8e522e93c43c12fe50b34300326c2e1ef206b6d1
4
+ data.tar.gz: 5861974e036c92470a4a801bed477e5cebefa679cc9996a5d6f0258eaa484150
5
5
  SHA512:
6
- metadata.gz: 6a85cd1d407c11d4becb6d6d11636623b96c706325f8bbca52caf4bf0cdce079df65432cb076d01503a4d4d977c8a662c22622e27193aeafc87ffbdc8d934045
7
- data.tar.gz: '08f9b75f3057071f41effaf870f8d0927dca85d647726ba833371001c470a7a062ee74ac63b5acc2f284493d3a32373ffb6c3ca96f9428ffb762c83cfd804c42'
6
+ metadata.gz: f19a799d333485b6461e2d8cdeaec5643ec6ddf8f6a2ce1725f3c39269cc193cc5b1bc1e81266b6a33af87ec5d09b3ac2f857b48da61c3baded00a98d6935624
7
+ data.tar.gz: a08f6519a635e76944b3b7c2f08d5369b6f327e60e968391fcd5e09e703e8ed526d35d8e124f91cbff8c885fbf8d620f90e0a99b48e4289868a0c11925b43d51
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deimos-ruby (1.7.0.pre.beta1)
4
+ deimos-ruby (1.8.0.pre.beta1)
5
5
  avro_turf (~> 0.11)
6
6
  phobos (~> 1.9)
7
7
  ruby-kafka (~> 0.7)
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 and :topic.
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
@@ -5,6 +5,7 @@ module Deimos
5
5
  # Methods used by message-by-message (non-batch) consumers. These consumers
6
6
  # are invoked for every individual message.
7
7
  module MessageConsumption
8
+ extend ActiveSupport::Concern
8
9
  include Phobos::Handler
9
10
 
10
11
  # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.8.0-beta1'
4
+ VERSION = '1.8.0-beta2'
5
5
  end
@@ -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.beta1
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-06 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro_turf