Skip to content

Karafka Core Changelog

2.6.8 (2026-11-12)

  • [Feature] Add Helpers::Kafka::Config.enabled? that treats a librdkafka boolean setting as on only when it is true or "true".
  • [Change] Make Contractable::Contract.virtual raise ArgumentError when called inside nested. Such a rule ignored the nesting and got the root data.

2.6.7 (2026-11-10)

  • [Maintenance] Declare rake in the Gemfile. It came only through karafka-rdkafka, which will stop depending on it for precompiled platform gems.
  • [Enhancement] Make Taggable::Tags#add with the value a tag already has and #delete of a missing tag about 6x faster on MRI and JRuby.
  • [Fix] Make Contractable::Result#errors keep the first error when one path has more than one, instead of the last.
  • [Fix] Make Contractable::Contract#call return a successful result for a contract with no rules of its own, instead of raising NoMethodError.
  • [Fix] Make Contractable::Contract.rules return an empty Array for a contract with no rules, instead of nil.

2.6.6 (2026-10-25)

  • [Maintenance] Drop unused byebug from the test bundle.
  • [Maintenance] Close the producer in bindings_test.rb so the suite exits at once; on JRuby suite exit time dropped from ~315 s to 13–15 s.
  • [Fix] Make Taggable::Tags safe to read while another thread adds or removes tags. On JRuby a concurrent read could raise NullPointerException.
  • [Fix] Make Taggable#tags return one Tags per object when several threads call it first. On JRuby each thread could get its own Tags, and tags were lost.
  • [Fix] Make Notifications#register_event safe while other threads call #instrument. On JRuby a registered event could look unregistered or be dispatched without its method.
  • [Fix] Make the Monitor event name cache thread-safe for a namespace or Symbol event ids, so on JRuby concurrent #instrument calls no longer corrupt it.

2.6.5 (2026-10-19)

  • [EOL] Drop Ruby 3.2 support due to EOL; require Ruby 3.3+.
  • [Change] Use the offending value (event id, setting name, class or constant name) as the message of errors raised by Notifications, Configurable::Node, Configurable::Importer and the spec locators.

2.6.4 (2026-09-11)

  • [Enhancement] Add Configurable::Importer, a subclassable base for injecting memoized config readers into a class via include or extend.

2.6.3 (2026-08-31)

  • [Enhancement] Add Configurable::Injector, a reusable base for injecting default values into a config hash without overwriting user settings.

2.6.2 (2026-06-29)

  • [Enhancement] Document that a setting default is shared across all config instances, so a mutable default such as [] must not be changed in place.
  • [Enhancement] Document that a virtual rule must return a freshly built Array of [path, message] error pairs on each call; a memoized, shared or frozen array is unsupported.
  • [Fix] Require pathname explicitly, so Karafka::Core.gem_root no longer raises NameError when nothing else loaded it.
  • [Fix] Configurable::Node#register now raises the documented "already registered" ArgumentError for a name used by an unread lazy-with-constructor setting, which it previously overwrote silently.
  • [Fix] Stop a rescued error inside Contractable::Contract.nested from prefixing its path onto every rule defined afterwards.
  • [Fix] Report a missing path instead of raising NoMethodError when validating a non-Hash root with a 1-key or 2-key rule.
  • [Fix] Honor excluded_keys containing "cgrp" in StatisticsDecorator only_keys mode; the cgrp branch lacked the exclusion guard its brokers and topics siblings have.
  • [Fix] Guard the patched rdkafka error callback against a null client pointer, which librdkafka can pass early in client construction and which could segfault the process.
  • [Fix] Resolve fatal errors in the patched rdkafka error callback via RdkafkaError.build_fatal, so the real underlying error is reported instead of the generic ERR__FATAL marker.
  • [Fix] A lazy setting declared without a constructor (setting(:x, lazy: true)) no longer raises when read; it now behaves like a regular setting backed by its default.
  • [Fix] Stop Contract#call from raising NoMethodError when a virtual rule returns false.
  • [Fix] Make CallbacksManager thread-safe under concurrent add/delete during dispatch, so a callback registered or removed while callbacks were firing is no longer lost.
  • [Fix] Make Notifications subscriptions thread-safe, so a listener unsubscribing during dispatch no longer causes the next listener to be skipped.
  • [Fix] Report a freeze duration (_fd) of 0 for statistics keys that first appear mid-stream.
  • [Fix] Stop an assignment on a frozen Configurable::Node from leaving the setting in an inconsistent state.
  • [Fix] Stop Configurable::Node#to_h from raising for an unset setting that uses the ->(default) { ... } constructor form.
  • [Fix] Honor excluded_keys when combined with only_keys in StatisticsDecorator.
  • [Fix] Fix subject path detection in MinitestLocator and RSpecLocator when the tests root name repeats later in the path.

2.6.1 (2026-06-15)

  • [Enhancement] Speed up Contract#call by ~1.25–1.4x, the per-message validation path in WaterDrop producers.
  • [Enhancement] Speed up Monitor#instrument dispatch (~1.2x) on the common no-subscribers path.
  • [Enhancement] Speed up Configurable::Node settings reads (~1.4x flat, ~1.6x nested) on hot paths.
  • [Enhancement] Reduce object shape variations of config nodes by giving each settings layout its own anonymous Node subclass.
  • [Change] Reject reserved setting names in Configurable::Node#setting and #register with an ArgumentError, since they could corrupt the node state.
  • [Change] Config nodes are instances of anonymous Node subclasses: is_a?(Karafka::Core::Configurable::Node) still holds, but instance_of?(Node) is false and node.class.name is nil.
  • [Change] Assigning a setting on a frozen config node now raises FrozenError (previously the write silently mutated internal storage despite the freeze).
  • [Fix] Report a missing path instead of raising NoMethodError when a 3+ key rule path meets a non-Hash intermediate value.
  • [Fix] Symbolize setting names at definition time and on config store writes, so String setting names work end to end and cannot corrupt node internal state when they match reserved internal names.

2.6.0 (2026-06-10)

  • [Enhancement] Add Node#register to register keys at runtime on compiled nodes, for dynamic registries (e.g. named clusters) whose setting names are not known at class-load time.
  • [Enhancement] Enable all opt-in Ruby warning categories via Warning.categories, so new ones (e.g. strict_unused_block in Ruby 3.4+) are picked up automatically.

2.5.13 (2026-04-08)

  • [Enhancement] Extract decorate_partitions method from StatisticsDecorator to allow subclasses to filter which partitions are decorated (e.g. skip unassigned partitions in a consumer context).

2.5.12 (2026-04-02)

  • [Fix] Exclude test/ directory from gem releases to reduce package size.

2.5.11 (2026-04-02)

  • [Enhancement] Specialize Contract#dig for common 1-key and 2-key paths to avoid iterator overhead, yielding ~1.5x faster single-key lookups and ~1.45x faster two-key nested lookups.
  • [Enhancement] Replace Node#build_accessors @local_defs Array with Hash for O(1) membership checks instead of O(n) Array#include?, yielding up to ~5x faster accessor lookups at 50 settings.
  • [Enhancement] Stop allocating an Array on every Contract#call and #validate! call (~1.36x faster dispatch).
  • [Enhancement] Speed up Notifications#instrument with multiple listeners (~1.12x faster event dispatch).
  • [Enhancement] Cache a frozen success Result singleton via Result.success to eliminate 1 object allocation per successful Contract#call on the happy path.
  • [Enhancement] Speed up Node#deep_dup ~14x and cut its allocations from ~620 to ~66 objects for large configs.
  • [Enhancement] Stop allocating an Array on every CallbacksManager#call call.
  • [Enhancement] Build the Event payload hash lazily on #payload access, saving one Hash allocation per Notifications#instrument call with #[] access, for ~1.7x faster event dispatch.
  • [Enhancement] Speed up StatisticsDecorator#diff by ~13% at scale (10 brokers, 20 topics, 2000 partitions).
  • [Enhancement] Reorder StatisticsDecorator#diff type checks to test Numeric before Hash, matching the ~80% numeric value distribution in librdkafka statistics.
  • [Enhancement] Support an only_keys option in StatisticsDecorator to decorate only the listed numeric keys. With excluded_keys, this cuts decoration cost from ~80ms to ~8.5ms per call on large clusters.
  • [Enhancement] Cache Tags#to_a (~7x faster reads at 5 tags, ~28x at 20 tags).

2.5.10 (2026-03-02)

  • [Enhancement] Introduce MinitestLocator helper for minitest/spec subject class auto-discovery from test file paths.

2.5.9 (2026-03-02)

  • [Enhancement] Reduce StatisticsDecorator allocations from tens of thousands to one per call at scale.
  • [Enhancement] Inline StatisticsDecorator#append and #suffix_keys_for into #diff to reduce method call overhead by ~96% (from ~915k to ~39k calls at 6400 partitions).
  • [Enhancement] Support an excluded_keys option in StatisticsDecorator to skip unused librdkafka statistics subtrees (e.g. broker toppars, window stats), ~28% faster at scale.

2.5.8 (2025-11-23)

  • [Enhancement] Memoize StatisticsDecorator suffix keys to reduce string allocations (#268).

2.5.7 (2025-09-28)

  • [Enhancement] Optimize Node#deep_dup to reduce array allocations during configuration deep copying.
  • [Enhancement] Optimize Result#initialize to use shared EMPTY_HASH constant for successful validations.
  • [Enhancement] Optimize StatisticsDecorator#append string concatenation to reduce allocations.
  • [Enhancement] Optimize Notifications#instrument payload handling to avoid unnecessary hash merges for empty payloads.
  • [EOL] Remove Ruby 3.1 support due to EOL.

2.5.6 (2025-09-02)

  • [Change] Normalize how libs and dependencies are required (no functional change for the end user)
  • [Change] Set minimum karafka-rdkafka on 0.20.0 to support new features and allow for open range as both waterdrop and karafka manage this.

2.5.5 (2025-08-04)

  • [Enhancement] Remove reliance on Set class.

2.5.4 (2025-08-04)

  • [Fix] Fix old regression on misbehaviour when Object methods are overwritten.

2.5.3 (2025-08-04)

  • [Enhancement] Optimize code to mitigate the Ruby performance warning from Karafka::Core::Configurable::Node (#208)
  • [Enhancement] Raise errors on detected Ruby warnings.
  • [Change] Remove unused Ruby 2.7 code.
  • [Change] Remove funding_uri from the gemspec to minimize double-funding info.

2.5.2 (2025-06-11)

  • [Enhancement] Support #unsubscribe.
  • [Enhancement] Allow for providing a root scope path for error keys.
  • [Fix] Fix a bug where on no errors the result would be an array instead of a hash.
  • [Fix] Fix spec hanging when Kafka cluster on 9092 is running.

2.5.1 (2025-05-23)

  • [Change] Move to trusted-publishers and remove signing since no longer needed.

2.5.0 (2025-05-21)

  • [Change] Set minimum karafka-rdkafka on 0.19.2 to support new features.

2.4.11 (2025-03-20)

  • [Enhancement] Rename internal node #name method to #node_name so we can use #name as the attribute name.

2.4.10 (2025-03-14)

  • [Fix] Relax lock on karafka-rdkafka

2.4.9 (2025-03-03)

  • [Enhancement] Remove RspecLocator dependency on activesupport.

2.4.8 (2024-12-26)

  • [Maintenance] Declare logger as a dependency.

2.4.7 (2024-11-26)

  • [Fix] Make sure that karafka-core works with older versions of karafka-rdkafka that do not support macos fork mitigation.

2.4.6 (2024-11-26)

  • [Enhancement] Mitigate macos forking issues when librdkafka is not loaded to memory.
  • [Change] Allow karafka-rdkafka 0.18.0.

2.4.5 (2024-11-19)

  • [EOL] Drop Ruby 3.0 support according to the EOL schedule.
  • [Enhancement] Support listeners inspection via #listeners.
  • [Fix] Restore #available_events notifications bus method.
  • [Change] Set minimum karafka-rdkafka on 0.17.6 to support new features.

2.4.4 (2024-07-20)

  • [Change] Set minimum karafka-rdkafka on 0.16.0 to support new features and allow for 0.17.0.

2.4.3 (2024-06-18)

  • [Fix] Use Object instead of BasicObject for rule result comparison because of Time mismatch with BasicObject.

2.4.2 (2024-06-17)

  • [Enhancement] Allow karafka-rdkafka 0.16.x to be used since API compatible.

2.4.1 (2024-06-17)

  • [Enhancement] Provide fast-track for events without subscriptions to save on allocations.
  • [Enhancement] Save memory allocation on each contract rule validation execution.
  • [Enhancement] Save one allocation per float_now + 2-3x performance by using the Posix clock instead of Time.now.utc.to_f.
  • [Enhancement] Use direct float_millisecond precision in monotonic_now not to multiply by 1000 (allocations and CPU savings).
  • [Enhancement] Save one array allocation on one instrumentation.
  • [Enhancement] Allow clearing one event type (dorner).

2.4.0 (2024-04-26)

  • [EOL] Drop Ruby 2.7 support.
  • [Enhancement] Provide necessary alterations for custom oauth token callbacks to operate.
  • [Change] Set minimum karafka-rdkafka on 0.15.0 to support new features.

2.3.0 (2024-01-26)

  • [Change] Set minimum karafka-rdkafka on 0.14.8 to support new features.
  • [Change] Remove concurrent-ruby usage.

2.2.7 (2023-11-07)

  • [Change] Set minimum karafka-rdkafka on 0.13.9 to support alternative consumer builder.

2.2.6 (2023-11-03)

  • [Enhancement] Set backtrace for errors propagated via the errors callbacks.

2.2.5 (2023-10-31)

  • [EOL] Drop support for Ruby 2.6 due to incompatibilities in usage of ObjectSpace::WeakMap
  • [Change] Set minimum karafka-rdkafka on 0.13.8 to support consumer #position.

2.2.4 (2023-10-25)

  • [Enhancement] Allow for lazy evaluated constructors.
  • [Enhancement] Allow no-arg constructors.

2.2.3 (2023-10-17)

  • [Change] Set minimum karafka-rdkafka on 0.13.6.

2.2.2 (2023-09-11)

  • [Fix] Reuse previous frozen duration as a base for incoming computation.

2.2.1 (2023-09-10)

  • Optimize statistics decorator by minimizing number of new objects created.
  • Expand the decoration with the _fd value: the freeze duration in milliseconds, showing how long a value has not changed. Useful to detect stale values.

2.2.0 (2023-09-01)

  • [Maintenance] Update the signing cert (old expired)

2.1.1 (2023-06-28)

  • [Change] Set minimum karafka-rdkafka on 0.13.1.

2.1.0 (2023-06-19)

  • [Change] Set karafka-rdkafka requirement from >= 0.13.0 to <= 0.14.0.
  • [Change] Remove no longer needed patch.

2.0.13 (2023-05-26)

  • Set minimum karafka-rdkafka on 0.12.3.

2.0.12 (2023-02-23)

  • Introduce ability to tag certain objects by including the Karafka::Core::Taggable module.

2.0.11 (2023-02-12)

  • Set minimum karafka-rdkafka on 0.12.1.

2.0.10 (2023-02-01)

  • Move RspecLocator to core.

2.0.9 (2023-01-11)

  • Use karafka-rdkafka instead of rdkafka. This change is needed to ensure that all consecutive releases are stable and compatible.
  • Relax Ruby requirement to 2.6. It does not mean we officially support it but it may work. Go to Versions Lifecycle and EOL for more details.

2.0.8 (2023-01-07)

  • Add Karafka::Core::Helpers::Time utility for time reporting.

2.0.7 (2022-12-18)

  • Allow for recompilation of config upon injecting new config nodes.
  • Compile given config scope automatically after it is defined.
  • Support sub-config merging via their nested definitions.

2.0.6 (2022-12-07)

  • Reverse node compilation state tracking removal.

2.0.5 (2022-12-07)

  • Move librdkafka generic (producer and consumer) patches from WaterDrop here.
  • Move dependency on librdkafka here from both Karafka and WaterDrop to unify management.
  • Move CallbacksManager from WaterDrop because it's shared.

2.0.4 (2022-11-20)

  • Disallow publishing events that were not registered.
  • Fix a potential race condition when adding listeners concurrently from multiple threads.

2.0.3 (2022-10-13)

  • Maintenance release. Cert chain update. No code changes.

2.0.2 (2022-08-01)

  • Add extracted statistics decorator (#932)

2.0.1 (2022-07-30)

  • Fix a case where setting would match a method monkey-patched on an object (#1) causing initializers not to build proper accessors on nodes. This is not the core bug, but still worth handling this case.

2.0.0 (2022-07-28)

  • Initial extraction of common components used in the Karafka ecosystem from WaterDrop.

Last modified: 2026-11-12 09:43:41