Ruby and Rails efficient Kafka processing framework
OTHER License
Bot releases are hidden (Show)
Published by mensfeld almost 2 years ago
#pause
.#id
to consumers similar to other entities for ease of debugging.LoggerListener
.terminated
state that will kick in prior to exit but after all the instrumentation and other things are done.Karafka::App
.#to_s
for reporting.SecureRandom#uuid
to SecureRandom#hex(6)
consumer_persistence
is enabled.If you want to disable librdkafka
statistics because you do not use them at all, update the kafka
statistics.interval.ms
setting and set it to 0
:
class KarafkaApp < Karafka::App
setup do |config|
# Other settings...
config.kafka = {
'statistics.interval.ms': 0
}
end
end
Published by mensfeld almost 2 years ago
waterdrop
and karafka-core
Admin#read_topic
API to get topic data without subscribing.#pause
, do not commit the offset in automatic offset management mode. This will prevent from a scenario where pause is needed but during it a rebalance occurs and a different assigned process starts not from the pause location but from the automatic offset that may be different. This still allows for using the #mark_as_consumed
.#pause
would be overwritten by a resume initiated by the strategy.#pause
in LRJ would cause infinite pause.Published by mensfeld almost 2 years ago
karafka info
subscription groups count reporting as it was misleading.nil
as a subscription_group
block argument.--consumer_groups
CLI flag.$stdout
.Published by mensfeld almost 2 years ago
Published by mensfeld almost 2 years ago
group.instance.id
assignment (static group membership) for a case where a single consumer group has multiple subscription groups (#1173).Published by mensfeld almost 2 years ago
Concurrent::Hash
.Published by mensfeld almost 2 years ago
TSTP
signal. When used, Karafka will finish processing current messages, run shutdown
jobs, and switch to a quiet mode where no new work is being accepted. At the same time, it will keep the consumer group quiet, and thus no rebalance will be triggered. This can be particularly useful during deployments.#revoked
for jobs in case revocation would happen during shutdown when jobs are still running. This should ensure we get a notion of revocation for Pro LRJ jobs even when revocation happens upon shutdown (#1150).Published by mensfeld almost 2 years ago
original-*
references from DLQ dispatched metadata with original_*
# DLQ topic consumption
def consume
messages.each do |broken_message|
topic = broken_message.metadata['original_topic'] # was original-topic
partition = broken_message.metadata['original_partition'] # was original-partition
offset = broken_message.metadata['original_offset'] # was original-offset
Rails.logger.error "This message is broken: #{topic}/#{partition}/#{offset}"
end
end
Published by mensfeld almost 2 years ago
manual_offset_management
setting and require it to be configured per topic. This is part of "topic features" configuration extraction for better code organization.Datadog::LoggerListener
for tracking logger data with DataDog (@bruno-b-martins)seek_offset
in the consumer.consume.error
event payload (#1113)Karafka::Pro::BaseConsumer
(#1116)#active_job_topic
without extra block options would cause manual_offset_management
to stay false.ActiveRecord
connection to the pool after the work in non-dev envs (#1130)manual_offset_management
setting from the main config if you use it:class KarafkaApp < Karafka::App
setup do |config|
# ...
# This line needs to be removed:
config.manual_offset_management = true
end
end
manual_offset_management
feature flag per each topic where you want to use it in the routing. Don't set it for topics where you want the default offset management strategy to be used.class KarafkaApp < Karafka::App
routes.draw do
consumer_group :group_name do
topic :example do
consumer ExampleConsumer
manual_offset_management true
end
topic :example2 do
consumer ExampleConsumer2
manual_offset_management true
end
end
end
end
class ActiveRecordConnectionsCleaner
def on_error_occurred(event)
return unless event[:error].is_a?(ActiveRecord::StatementInvalid)
::ActiveRecord::Base.clear_active_connections!
end
end
Karafka.monitor.subscribe(ActiveRecordConnectionsCleaner.new)
It should be removed. This code is no longer needed.
Published by mensfeld almost 2 years ago
Published by mensfeld about 2 years ago
Karafka::Embedded
to simplify the start/stop process when running Karafka from within other process (Puma, Sidekiq, etc).Published by mensfeld about 2 years ago
Published by mensfeld about 2 years ago
concurrent-ruby
missing as a dependency (Azdaroth)Published by mensfeld about 2 years ago
This is an important release because:
https://rubygems.org/gems/karafka/versions/2.0.12
https://my.diffend.io/gems/karafka/2.0.11/2.0.12
Published by mensfeld about 2 years ago
Published by mensfeld about 2 years ago
librdkafka
instance.Published by mensfeld about 2 years ago
manual_offset_management
offset upon error is not reverted to the first message in a case where there were no markings as consumed at all for multiple batches.active_job_topic
with Virtual Partitions and manual offset management (ActiveJob still can use due to the atomicity of jobs).librdkafka
to do so.Published by mensfeld about 2 years ago
concurrency
to max_partitions
to avoid confusion (#1023).Published by mensfeld about 2 years ago
concurrency
setting in Virtual Partitions to extend or limit number of jobs per regular partition. This allows to make sure, we do not use all the threads on virtual partitions jobsconcurrency
into considerationPublished by mensfeld about 2 years ago
Subscription groups feature explanation can be found here: https://karafka.io/docs/Concurrency-and-multithreading/#consumer-groups-and-topics-structure