diff --git a/CHANGELOG.md b/CHANGELOG.md index f43076c..b3024ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -## [3.2.3] - 2024-09-30 +## [3.3.0] - 2024-09-30 + +### Added + +- inheritance of kafka settings for topic ### Fixed +- support `karafka 2.4.12` - properly report metrics for consumer offset lag when partition fetch assignment was lost ## [3.2.2] - 2024-09-23 diff --git a/lib/sbmt/kafka_consumer/client_configurer.rb b/lib/sbmt/kafka_consumer/client_configurer.rb index bd906aa..f316d8d 100644 --- a/lib/sbmt/kafka_consumer/client_configurer.rb +++ b/lib/sbmt/kafka_consumer/client_configurer.rb @@ -57,7 +57,7 @@ def self.configure!(**opts) manual_offset_management t.manual_offset_management consumer t.consumer.consumer_klass deserializer t.deserializer.instantiate if t.deserializer.klass.present? - kafka t.kafka_options if t.kafka_options.present? + kafka t.kafka_options.merge(inherit: true) if t.kafka_options.present? end end end diff --git a/lib/sbmt/kafka_consumer/version.rb b/lib/sbmt/kafka_consumer/version.rb index f24ee78..001c20f 100644 --- a/lib/sbmt/kafka_consumer/version.rb +++ b/lib/sbmt/kafka_consumer/version.rb @@ -2,6 +2,6 @@ module Sbmt module KafkaConsumer - VERSION = "3.2.3" + VERSION = "3.3.0" end end diff --git a/sbmt-kafka_consumer.gemspec b/sbmt-kafka_consumer.gemspec index 603fce5..6f83f6c 100644 --- a/sbmt-kafka_consumer.gemspec +++ b/sbmt-kafka_consumer.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_dependency "rails", ">= 6.1" spec.add_dependency "zeitwerk", "~> 2.3" - spec.add_dependency "karafka", "~> 2.4", "< 2.4.12" + spec.add_dependency "karafka", "~> 2.4" spec.add_dependency "yabeda", ">= 0.11" spec.add_dependency "anyway_config", ">= 2.4.0" spec.add_dependency "thor" diff --git a/spec/sbmt/kafka_consumer/client_configurer_spec.rb b/spec/sbmt/kafka_consumer/client_configurer_spec.rb index d23c2f0..f72155a 100644 --- a/spec/sbmt/kafka_consumer/client_configurer_spec.rb +++ b/spec/sbmt/kafka_consumer/client_configurer_spec.rb @@ -15,7 +15,17 @@ hash_including( active: true, initial_offset: "earliest", - kafka: {"auto.offset.reset": "latest"}, + kafka: hash_including( + "auto.offset.reset": "latest", + "allow.auto.create.topics": true, + "bootstrap.servers": "kafka:9092", + "heartbeat.interval.ms": 5000, + "reconnect.backoff.max.ms": 3000, + "security.protocol": "plaintext", + "session.timeout.ms": 30000, + "socket.connection.setup.timeout.ms": 5000, + "socket.timeout.ms": 30000 + ), manual_offset_management: {active: true}, max_messages: 100, max_wait_time: 1000,