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 istrueor"true". - [Change] Make
Contractable::Contract.virtualraiseArgumentErrorwhen called insidenested. Such a rule ignored the nesting and got the root data.
2.6.7 (2026-11-10)¶
- [Maintenance] Declare
rakein theGemfile. It came only throughkarafka-rdkafka, which will stop depending on it for precompiled platform gems. - [Enhancement] Make
Taggable::Tags#addwith the value a tag already has and#deleteof a missing tag about 6x faster on MRI and JRuby. - [Fix] Make
Contractable::Result#errorskeep the first error when one path has more than one, instead of the last. - [Fix] Make
Contractable::Contract#callreturn a successful result for a contract with no rules of its own, instead of raisingNoMethodError. - [Fix] Make
Contractable::Contract.rulesreturn an empty Array for a contract with no rules, instead ofnil.
2.6.6 (2026-10-25)¶
- [Maintenance] Drop unused
byebugfrom the test bundle. - [Maintenance] Close the producer in
bindings_test.rbso the suite exits at once; on JRuby suite exit time dropped from ~315 s to 13–15 s. - [Fix] Make
Taggable::Tagssafe to read while another thread adds or removes tags. On JRuby a concurrent read could raiseNullPointerException. - [Fix] Make
Taggable#tagsreturn oneTagsper object when several threads call it first. On JRuby each thread could get its ownTags, and tags were lost. - [Fix] Make
Notifications#register_eventsafe while other threads call#instrument. On JRuby a registered event could look unregistered or be dispatched without its method. - [Fix] Make the
Monitorevent name cache thread-safe for a namespace or Symbol event ids, so on JRuby concurrent#instrumentcalls 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::Importerand the spec locators.
2.6.4 (2026-09-11)¶
- [Enhancement] Add
Configurable::Importer, a subclassable base for injecting memoized config readers into a class viaincludeorextend.
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
virtualrule must return a freshly builtArrayof[path, message]error pairs on each call; a memoized, shared or frozen array is unsupported. - [Fix] Require
pathnameexplicitly, soKarafka::Core.gem_rootno longer raisesNameErrorwhen nothing else loaded it. - [Fix]
Configurable::Node#registernow raises the documented "already registered"ArgumentErrorfor a name used by an unread lazy-with-constructor setting, which it previously overwrote silently. - [Fix] Stop a rescued error inside
Contractable::Contract.nestedfrom prefixing its path onto every rule defined afterwards. - [Fix] Report a missing path instead of raising
NoMethodErrorwhen validating a non-Hash root with a 1-key or 2-key rule. - [Fix] Honor
excluded_keyscontaining"cgrp"inStatisticsDecoratoronly_keysmode; thecgrpbranch lacked the exclusion guard itsbrokersandtopicssiblings 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 genericERR__FATALmarker. - [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#callfrom raisingNoMethodErrorwhen a virtual rule returnsfalse. - [Fix] Make
CallbacksManagerthread-safe under concurrentadd/deleteduring dispatch, so a callback registered or removed while callbacks were firing is no longer lost. - [Fix] Make
Notificationssubscriptions thread-safe, so a listener unsubscribing during dispatch no longer causes the next listener to be skipped. - [Fix] Report a freeze duration (
_fd) of0for statistics keys that first appear mid-stream. - [Fix] Stop an assignment on a frozen
Configurable::Nodefrom leaving the setting in an inconsistent state. - [Fix] Stop
Configurable::Node#to_hfrom raising for an unset setting that uses the->(default) { ... }constructor form. - [Fix] Honor
excluded_keyswhen combined withonly_keysinStatisticsDecorator. - [Fix] Fix subject path detection in
MinitestLocatorandRSpecLocatorwhen the tests root name repeats later in the path.
2.6.1 (2026-06-15)¶
- [Enhancement] Speed up
Contract#callby ~1.25–1.4x, the per-message validation path in WaterDrop producers. - [Enhancement] Speed up
Monitor#instrumentdispatch (~1.2x) on the common no-subscribers path. - [Enhancement] Speed up
Configurable::Nodesettings 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
Nodesubclass. - [Change] Reject reserved setting names in
Configurable::Node#settingand#registerwith anArgumentError, since they could corrupt the node state. - [Change] Config nodes are instances of anonymous
Nodesubclasses:is_a?(Karafka::Core::Configurable::Node)still holds, butinstance_of?(Node)isfalseandnode.class.nameisnil. - [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
NoMethodErrorwhen a 3+ key rule path meets a non-Hash intermediate value. - [Fix] Symbolize setting names at definition time and on config store writes, so
Stringsetting 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#registerto 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_blockin Ruby 3.4+) are picked up automatically.
2.5.13 (2026-04-08)¶
- [Enhancement] Extract
decorate_partitionsmethod fromStatisticsDecoratorto 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#digfor 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_defsArray 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#calland#validate!call (~1.36x faster dispatch). - [Enhancement] Speed up
Notifications#instrumentwith multiple listeners (~1.12x faster event dispatch). - [Enhancement] Cache a frozen success
Resultsingleton viaResult.successto eliminate 1 object allocation per successfulContract#callon 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#callcall. - [Enhancement] Build the
Eventpayload hash lazily on#payloadaccess, saving one Hash allocation perNotifications#instrumentcall with#[]access, for ~1.7x faster event dispatch. - [Enhancement] Speed up
StatisticsDecorator#diffby ~13% at scale (10 brokers, 20 topics, 2000 partitions). - [Enhancement] Reorder
StatisticsDecorator#difftype checks to testNumericbeforeHash, matching the ~80% numeric value distribution in librdkafka statistics. - [Enhancement] Support an
only_keysoption inStatisticsDecoratorto decorate only the listed numeric keys. Withexcluded_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
MinitestLocatorhelper for minitest/spec subject class auto-discovery from test file paths.
2.5.9 (2026-03-02)¶
- [Enhancement] Reduce
StatisticsDecoratorallocations from tens of thousands to one per call at scale. - [Enhancement] Inline
StatisticsDecorator#appendand#suffix_keys_forinto#diffto reduce method call overhead by ~96% (from ~915k to ~39k calls at 6400 partitions). - [Enhancement] Support an
excluded_keysoption inStatisticsDecoratorto skip unused librdkafka statistics subtrees (e.g. broker toppars, window stats), ~28% faster at scale.
2.5.8 (2025-11-23)¶
- [Enhancement] Memoize
StatisticsDecoratorsuffix keys to reduce string allocations (#268).
2.5.7 (2025-09-28)¶
- [Enhancement] Optimize
Node#deep_dupto reduce array allocations during configuration deep copying. - [Enhancement] Optimize
Result#initializeto use sharedEMPTY_HASHconstant for successful validations. - [Enhancement] Optimize
StatisticsDecorator#appendstring concatenation to reduce allocations. - [Enhancement] Optimize
Notifications#instrumentpayload 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-rdkafkaon0.20.0to support new features and allow for open range as bothwaterdropandkarafkamanage this.
2.5.5 (2025-08-04)¶
- [Enhancement] Remove reliance on
Setclass.
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_urifrom 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-rdkafkaon0.19.2to support new features.
2.4.11 (2025-03-20)¶
- [Enhancement] Rename internal node
#namemethod to#node_nameso we can use#nameas the attribute name.
2.4.10 (2025-03-14)¶
- [Fix] Relax lock on
karafka-rdkafka
2.4.9 (2025-03-03)¶
- [Enhancement] Remove
RspecLocatordependency onactivesupport.
2.4.8 (2024-12-26)¶
- [Maintenance] Declare
loggeras a dependency.
2.4.7 (2024-11-26)¶
- [Fix] Make sure that
karafka-coreworks with older versions ofkarafka-rdkafkathat 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-rdkafka0.18.0.
2.4.5 (2024-11-19)¶
- [EOL] Drop Ruby
3.0support according to the EOL schedule. - [Enhancement] Support listeners inspection via
#listeners. - [Fix] Restore
#available_eventsnotifications bus method. - [Change] Set minimum
karafka-rdkafkaon0.17.6to support new features.
2.4.4 (2024-07-20)¶
- [Change] Set minimum
karafka-rdkafkaon0.16.0to support new features and allow for0.17.0.
2.4.3 (2024-06-18)¶
- [Fix] Use
Objectinstead ofBasicObjectfor rule result comparison because of Time mismatch with BasicObject.
2.4.2 (2024-06-17)¶
- [Enhancement] Allow
karafka-rdkafka0.16.xto 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 ofTime.now.utc.to_f. - [Enhancement] Use direct
float_millisecondprecision inmonotonic_nownot 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.7support. - [Enhancement] Provide necessary alterations for custom oauth token callbacks to operate.
- [Change] Set minimum
karafka-rdkafkaon0.15.0to support new features.
2.3.0 (2024-01-26)¶
- [Change] Set minimum
karafka-rdkafkaon0.14.8to support new features. - [Change] Remove
concurrent-rubyusage.
2.2.7 (2023-11-07)¶
- [Change] Set minimum
karafka-rdkafkaon0.13.9to 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-rdkafkaon0.13.8to support consumer#position.
2.2.4 (2023-10-25)¶
- [Enhancement] Allow for
lazyevaluated constructors. - [Enhancement] Allow no-arg constructors.
2.2.3 (2023-10-17)¶
- [Change] Set minimum
karafka-rdkafkaon0.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
_fdvalue: 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-rdkafkaon0.13.1.
2.1.0 (2023-06-19)¶
- [Change] Set
karafka-rdkafkarequirement from>= 0.13.0to<= 0.14.0. - [Change] Remove no longer needed patch.
2.0.13 (2023-05-26)¶
- Set minimum
karafka-rdkafkaon0.12.3.
2.0.12 (2023-02-23)¶
- Introduce ability to tag certain objects by including the
Karafka::Core::Taggablemodule.
2.0.11 (2023-02-12)¶
- Set minimum
karafka-rdkafkaon0.12.1.
2.0.10 (2023-02-01)¶
- Move
RspecLocatorto core.
2.0.9 (2023-01-11)¶
- Use
karafka-rdkafkainstead ofrdkafka. 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::Timeutility 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
librdkafkageneric (producer and consumer) patches from WaterDrop here. - Move dependency on
librdkafkahere from both Karafka and WaterDrop to unify management. - Move
CallbacksManagerfrom 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