karafka 1.3.0 → 1.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.diffend.yml +3 -0
- data/.github/workflows/ci.yml +76 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +112 -15
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +87 -98
- data/README.md +28 -31
- data/certs/mensfeld.pem +24 -23
- data/config/errors.yml +2 -0
- data/docker-compose.yml +17 -0
- data/karafka.gemspec +22 -14
- data/lib/karafka/assignment_strategies/round_robin.rb +13 -0
- data/lib/karafka/attributes_map.rb +3 -8
- data/lib/karafka/cli/base.rb +4 -4
- data/lib/karafka/cli/flow.rb +9 -6
- data/lib/karafka/cli/info.rb +1 -1
- data/lib/karafka/cli/install.rb +5 -2
- data/lib/karafka/cli/missingno.rb +19 -0
- data/lib/karafka/cli/server.rb +8 -8
- data/lib/karafka/cli.rb +9 -1
- data/lib/karafka/connection/api_adapter.rb +27 -24
- data/lib/karafka/connection/batch_delegator.rb +5 -1
- data/lib/karafka/connection/builder.rb +9 -2
- data/lib/karafka/connection/client.rb +9 -6
- data/lib/karafka/connection/listener.rb +2 -2
- data/lib/karafka/consumers/batch_metadata.rb +10 -0
- data/lib/karafka/consumers/includer.rb +5 -4
- data/lib/karafka/contracts/consumer_group.rb +10 -5
- data/lib/karafka/contracts/server_cli_options.rb +2 -0
- data/lib/karafka/contracts.rb +1 -1
- data/lib/karafka/helpers/class_matcher.rb +2 -2
- data/lib/karafka/instrumentation/logger.rb +6 -9
- data/lib/karafka/instrumentation/stdout_listener.rb +6 -4
- data/lib/karafka/params/batch_metadata.rb +26 -0
- data/lib/karafka/params/builders/batch_metadata.rb +30 -0
- data/lib/karafka/params/builders/params.rb +17 -15
- data/lib/karafka/params/builders/params_batch.rb +2 -2
- data/lib/karafka/params/metadata.rb +14 -29
- data/lib/karafka/params/params.rb +27 -41
- data/lib/karafka/params/params_batch.rb +15 -16
- data/lib/karafka/routing/builder.rb +1 -0
- data/lib/karafka/routing/consumer_group.rb +5 -3
- data/lib/karafka/serialization/json/deserializer.rb +2 -2
- data/lib/karafka/server.rb +4 -1
- data/lib/karafka/setup/config.rb +60 -52
- data/lib/karafka/templates/karafka.rb.erb +1 -1
- data/lib/karafka/version.rb +1 -1
- data/lib/karafka.rb +3 -1
- data.tar.gz.sig +0 -0
- metadata +75 -93
- metadata.gz.sig +0 -0
- data/.github/FUNDING.yml +0 -3
- data/.travis.yml +0 -36
- data/lib/karafka/consumers/metadata.rb +0 -10
- data/lib/karafka/params/builders/metadata.rb +0 -33
data/.travis.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
services:
|
2
|
-
- docker
|
3
|
-
|
4
|
-
dist: trusty
|
5
|
-
sudo: false
|
6
|
-
cache: bundler
|
7
|
-
|
8
|
-
git:
|
9
|
-
depth: false
|
10
|
-
|
11
|
-
test: &test
|
12
|
-
stage: Test
|
13
|
-
language: ruby
|
14
|
-
before_install:
|
15
|
-
- gem install bundler
|
16
|
-
- gem update --system
|
17
|
-
script: bundle exec rspec
|
18
|
-
|
19
|
-
jobs:
|
20
|
-
include:
|
21
|
-
- <<: *test
|
22
|
-
rvm: 2.6.3
|
23
|
-
- <<: *test
|
24
|
-
rvm: 2.5.5
|
25
|
-
|
26
|
-
- stage: coditsu
|
27
|
-
language: ruby
|
28
|
-
rvm: 2.6.3
|
29
|
-
before_install:
|
30
|
-
- gem update --system
|
31
|
-
- gem install bundler
|
32
|
-
script: \curl -sSL https://api.coditsu.io/run/ci | bash
|
33
|
-
|
34
|
-
stages:
|
35
|
-
- coditsu
|
36
|
-
- test
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Karafka
|
4
|
-
module Params
|
5
|
-
module Builders
|
6
|
-
# Builder for creating metadata object based on the message or batch informations
|
7
|
-
# @note We have 2 ways of creating metadata based on the way ruby-kafka operates
|
8
|
-
module Metadata
|
9
|
-
class << self
|
10
|
-
# Creates metadata based on the kafka batch data
|
11
|
-
# @param kafka_batch [Kafka::FetchedBatch] kafka batch details
|
12
|
-
# @param topic [Karafka::Routing::Topic] topic for which we've fetched the batch
|
13
|
-
# @return [Karafka::Params::Metadata] metadata object
|
14
|
-
def from_kafka_batch(kafka_batch, topic)
|
15
|
-
Karafka::Params::Metadata
|
16
|
-
.new
|
17
|
-
.merge!(
|
18
|
-
'batch_size' => kafka_batch.messages.count,
|
19
|
-
'first_offset' => kafka_batch.first_offset,
|
20
|
-
'highwater_mark_offset' => kafka_batch.highwater_mark_offset,
|
21
|
-
'last_offset' => kafka_batch.last_offset,
|
22
|
-
'offset_lag' => kafka_batch.offset_lag,
|
23
|
-
'deserializer' => topic.deserializer,
|
24
|
-
'partition' => kafka_batch.partition,
|
25
|
-
'topic' => kafka_batch.topic,
|
26
|
-
'unknown_last_offset' => kafka_batch.unknown_last_offset?
|
27
|
-
)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|