All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- inheritance of kafka settings for topic
- support
karafka 2.4.12
- properly report metrics for consumer offset lag when partition fetch assignment was lost
- log OTEL
trace_id
- Limit Karafka version to less than 2.4.12 since
bootstrap.servers
has been made required
- For synchronous messages and errors, we place logs in tags
- Refactor consumer class initialization
- Drop support for Ruby 2.7
- Drop support for Rails 6.0
- Add support for Karafka 2.4
- Support consumer group mappers to support backward compatibility of consumer group naming
- Refactor consumer class initialization
- Add mock
mark_as_consumed
for tests
- When using strategy
cooperative-sticky
, methodmark_as_consumed
is used (more details)
- Use the current
trace_id
instead of creating a new one
- Added instrumentation for methods
process_message
andmark_as_consumed!
- From
do_consume(message)
toyield
- Added option
max_error_count
for liveness probes, which is triggered whenlibrdkafka.error
- Fixed display of metrics
kafka_api_calls
andkafka_api_errors
- Added option
midlewares
to add middleware before message processing
- Rename from
export_batch
toprocess_batch
- New config option
partition_assignment_strategy
- Raise an exception when using the
partition.assignment.strategy
option withinkafka_options
for topics.
- Drop support for Rails 5.2
- Add support for Ruby 3.3
- Implemented method
export_batch
for processing messages in batches
- Limit the Karafka version to less than
2.4
because they dropped the consumer group mapping
- Remove
sbmt-dev
- Use mainstream karafka instead of custom fork
- ability to override
kafka_options
for topic
- removed useless
outbox_producer
param forInboxConsumer
class - removed useless log messages from
InboxConsumer
class
- initialization of proxy consumer classes
- consumer class name in sentry's transaction name
- New config options
metrics
metrics.port
for a metrics port that is different from the probes portmetrics.path
for a metrics path
- Stub kafka_client to prevent calls to librdkafka: fixes SEGFAULT in parallel tests
- disable karafka's
config.strict_topics_namespacing
outbox_producer
configuration flag
- Use
Rails.application.executor.wrap
instead manual AR connection clearing
- Fix broken outbox item generator call in the
kafka_consumer:inbox_consumer
generator
- Properly extract opentelemetry context from kafka message headers
- Port
v0.17.5
(properly clearActiveRecord
connections in caseskip_on_error
option is used) to master (v0.18)
- OpenTelemetry tracing
- Properly clear
ActiveRecord
connections in caseskip_on_error
option is used
- Latency metrics in seconds instead ms
- Decreased sleep time on db error in a consumer
- Fix
message.metadata.key
validation if key is an empty string
- Check Idempotency-Key for a empty string
- ability to configure consumer group mapper in
kafka_consumer.yml
(needed for proper migration from existing karafka v2 based consumers) - ability to define/override inbox-item attributes in InboxConsumer
- report
kafka_consumer_inbox_consumes
metric with tagstatus = skipped
(insteadfailure
) if skip_on_error is enabled on InboxConsumer
- additional tags (client, group_id, partition, topic) for metric
kafka_consumer_inbox_consumes
kafka_consumer:install
generatorkafka_consumer:consumer_group
generatorkafka_consumer:consumer
generator
.clear_all_connections!
is now called for all DB roles
- add label
api
for groupkafka_api
- README improvements
- report message payload and headers to Sentry if consumer detailed logging is enabled
event_key
callback added toSbmt::KafkaConsumer::InboxConsumer
- logging / instrumentation improvements
- README improvements
- update sbmt-waterdrop (via sbmt-karafka) to fix karafka-rdkafka 0.13 compatibility issue
skip_on_error
consumer option to skip message processing (and commit offsets) if exception was raised
SimpleLoggingConsumer
, which just consumes/logs messages, can be used for debug purposes
- add custom
ConsumerMapper
to be consistent with KarafkaV1 consumer-group naming conventions (e.g. karafka v1 uses underscored client-id in consumer group name) - reuse with_db_retry: release ActiveRecord conn everytime after message processing, in case there's a connection-pool degradation
- update sbmt-karafka to 2.1.3
- remove db retries logic as
ActiveRecord::Base::clear_active_connections!
is already handled by karafka v2 after processing a batch - async metrics reporting for
statistics.emitted
event to prevent rdkafka's main thread hanging, see https://github.com/karafka/karafka/pull/1420/files - use Rails logger by default
- use
$stdout.sync = true
in consumer server process to avoid STDOUT buffering issues in docker/k8s
- db error logging in base consumer
- add
Sbmt::KafkaConsumer::Instrumentation::LivenessListener
andSbmt::KafkaConsumer::Instrumentation::ReadinessListener
listeners - add
probes
option - add
HttpHealthCheck
server with probes' endpoints
- set default
source: "KAFKA"
option when creatinginbox_item
inInboxConsumer
- add
manual_offset_management
topic's option (defaults to true) - add consumer
group_id
to inbox-item metadata (InboxConsumer)
- sentry tracing when instrumentation event is not an exception
- payload deserialization if skip_decoding_error is enabled
- add default deserializer (NullDeserializer) to config
- refactor logging
- refactor consumer groups config
- add timeout aliases to kafka config
- README actualization
- implement consumer metrics
- base config loader via AnywayConfig
- BaseConsumer
- InboxConsumer
- Instrumentation listeners: sentry, logger, yabeda
- Initial release