Class: Karafka::Pro::Routing::Features::OffsetMetadata
- Inherits:
-
Base
- Object
- Routing::Features::Base
- Base
- Karafka::Pro::Routing::Features::OffsetMetadata
- Defined in:
- lib/karafka/pro/routing/features/offset_metadata.rb,
lib/karafka/pro/routing/features/offset_metadata/topic.rb,
lib/karafka/pro/routing/features/offset_metadata/config.rb,
lib/karafka/pro/routing/features/offset_metadata/contracts/topic.rb
Overview
Note:
Because this feature has zero performance impact and makes no queries to Kafka unless requested, it is always enabled.
This feature allows for saving and retrieving offset metadata with custom deserialization support. It allows for storing extra data during commits that can be then used to alter the processing flow after a rebalance.
Defined Under Namespace
Modules: Contracts, Topic Classes: Config
Class Method Summary collapse
-
.post_setup(_config) ⇒ Object
If needed installs the needed listener and initializes tracker.
Methods inherited from Routing::Features::Base
activate, load_all, post_setup_all, pre_setup_all
Class Method Details
.post_setup(_config) ⇒ Object
If needed installs the needed listener and initializes tracker
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/karafka/pro/routing/features/offset_metadata.rb', line 33 def post_setup(_config) Karafka::App.monitor.subscribe('app.running') do # Initialize the tracker prior to becoming multi-threaded Karafka::Processing::InlineInsights::Tracker.instance # Subscribe to the statistics reports and collect them Karafka.monitor.subscribe( Karafka::Pro::Processing::OffsetMetadata::Listener.new ) end end |