karafka 1.3.0 → 1.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -2
  3. data.tar.gz.sig +0 -0
  4. data/.diffend.yml +3 -0
  5. data/.github/workflows/ci.yml +52 -0
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +61 -15
  8. data/CODE_OF_CONDUCT.md +1 -1
  9. data/Gemfile +2 -0
  10. data/Gemfile.lock +59 -57
  11. data/README.md +3 -5
  12. data/certs/mensfeld.pem +21 -21
  13. data/docker-compose.yml +17 -0
  14. data/karafka.gemspec +5 -6
  15. data/lib/karafka.rb +2 -1
  16. data/lib/karafka/attributes_map.rb +2 -8
  17. data/lib/karafka/cli.rb +1 -1
  18. data/lib/karafka/cli/flow.rb +9 -6
  19. data/lib/karafka/cli/info.rb +1 -1
  20. data/lib/karafka/cli/install.rb +2 -0
  21. data/lib/karafka/connection/api_adapter.rb +12 -6
  22. data/lib/karafka/connection/batch_delegator.rb +5 -1
  23. data/lib/karafka/connection/builder.rb +4 -2
  24. data/lib/karafka/connection/client.rb +1 -1
  25. data/lib/karafka/connection/listener.rb +2 -2
  26. data/lib/karafka/consumers/batch_metadata.rb +10 -0
  27. data/lib/karafka/consumers/includer.rb +5 -4
  28. data/lib/karafka/contracts/consumer_group.rb +2 -2
  29. data/lib/karafka/contracts/server_cli_options.rb +2 -0
  30. data/lib/karafka/helpers/class_matcher.rb +1 -1
  31. data/lib/karafka/instrumentation/logger.rb +4 -3
  32. data/lib/karafka/instrumentation/stdout_listener.rb +4 -2
  33. data/lib/karafka/params/batch_metadata.rb +26 -0
  34. data/lib/karafka/params/builders/batch_metadata.rb +30 -0
  35. data/lib/karafka/params/builders/params.rb +17 -15
  36. data/lib/karafka/params/builders/params_batch.rb +2 -2
  37. data/lib/karafka/params/metadata.rb +14 -29
  38. data/lib/karafka/params/params.rb +24 -42
  39. data/lib/karafka/params/params_batch.rb +15 -16
  40. data/lib/karafka/serialization/json/deserializer.rb +2 -2
  41. data/lib/karafka/server.rb +4 -1
  42. data/lib/karafka/setup/config.rb +2 -0
  43. data/lib/karafka/version.rb +1 -1
  44. metadata +40 -51
  45. metadata.gz.sig +0 -0
  46. data/.travis.yml +0 -36
  47. data/lib/karafka/consumers/metadata.rb +0 -10
  48. data/lib/karafka/params/builders/metadata.rb +0 -33
metadata.gz.sig CHANGED
Binary file
@@ -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,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Karafka
4
- module Consumers
5
- # Brings the metadata into consumers that support batch_fetching
6
- module Metadata
7
- attr_accessor :metadata
8
- end
9
- end
10
- end
@@ -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