gems karafka 2.6.2.alpha2
v2.6.2.alpha2

one hour ago
  • [EOL] Drop Ruby 3.2 support; require Ruby 3.3+.
  • [EOL] Drop Rails 7.0 and 7.1 compatibility; require Rails 7.2+.
  • [Feature] Add Instrumentation::Vendors::NewRelic::MetricsListener for publishing Karafka metrics to New Relic. Context is encoded in the metric name, as New Relic custom metrics do not support tags (svyatmuzyka).
  • [Feature] Add karafka info --extended, printing the routing tree, global app config and effective Kafka config, with sensitive values redacted.
  • [Feature] Add Kubernetes::ReadinessListener, serving a readiness probe that reports healthy once all subscription groups poll and not-ready on shutdown or quieting, so pods drain before exiting.
  • [Feature] Allow the --include/--exclude CLI server filters to accept wildcard patterns (e.g. --exclude-consumer-groups app-a-*), including topics discovered at runtime by Pro routing patterns.
  • [Feature] Add Karafka::Admin.list_consumer_groups to list every consumer group in the cluster with its state. Requires karafka-rdkafka >= 0.31.0.
  • [Feature] Add Karafka::Admin.describe_consumer_groups to read consumer groups' state, protocol type (:classic, KIP-848 :consumer or :unknown), coordinator, assignor and members with their partition assignments. Requires karafka-rdkafka >= 0.31.0.
  • [Feature] Add Karafka::Admin.describe_cluster and .describe_topics to read the cluster id, controller, brokers with racks, topic ids, partition leaders and replicas, and optionally the authorized operations. Requires karafka-rdkafka >= 0.31.0.
  • [Feature] Add Karafka::Admin.delete_records to delete the messages of given partitions below a given offset (or all of them with :end) by moving their low watermark. It is destructive and irreversible.
  • [Feature] Add Karafka::Admin.delete_consumer_group_offsets to delete a consumer group's committed offsets for given topics or partitions, keeping the consumer group and its other offsets. Raises Karafka::Errors::ConsumerGroupSubscribedToTopicError for topics the consumer group is subscribed to.
  • [Feature] [Pro] Add Virtual Partitions Estimator, a console API that samples a topic and estimates how well Virtual Partitions would parallelize it. Results can be saved as a versioned JSON report (target_file:) and displayed with karafka vps report.
  • [Feature] Add Admin::Configs::Config#source (e.g. :dynamic_topic_config, :dynamic_broker_config, :default_config), also on synonyms, telling a value set on the topic from one inherited from the broker or a built-in default. Requires karafka-rdkafka >= 0.32.1.
  • [Feature] [Pro] Add Karafka::Pro::Admin::DeadLetterQueues.copy to replay DLQ messages (all, or given partitions and an offset range) back to their source topic and partition with their key and original headers, or to a given topic. Each copy increments a replay_count header.
  • [Feature] Add Karafka::Admin.read_committed_offsets to read all committed offsets of given consumer groups ({ group_id => { topic => { partition => offset } } }) without listing their topics.
  • [Feature] Add validate_only:, operation_timeout_ms: and request_timeout_ms: to Karafka::Admin.create_topic and .create_partitions (and their Admin::Topics counterparts). With validate_only: true the broker only validates the request. A topic config given without braces keeps working. Requires karafka-rdkafka >= 0.32.0.
  • [Enhancement] Defer default log file creation until the first write and keep logging working (to stdout) when the log file cannot be created or written, e.g. on read-only filesystems (ydah).
  • [Enhancement] Stop allocating 6 objects per consumed message: build the default topic deserializers only once and read max_messages once per poll batch.
  • [Enhancement] Stop allocating a keyword Hash per consumed message when building its metadata.
  • [Enhancement] Log only the top two backtrace lines for librdkafka.error in the LoggerListener, so unreachable brokers no longer flood the logs.
  • [Enhancement] Include the topic, partition and offset from librdkafka error details (e.g. a message that failed to decompress) in LoggerListener error logs. Only librdkafka errors are used, and the consumer's own context takes precedence.
  • [Enhancement] Instrument client.topics.unknown and log it at the info level when a subscribed topic does not exist yet and allow.auto.create.topics is on, instead of ignoring it silently.
  • [Enhancement] Support the :group resource type (Kafka's GROUP) in Karafka::Admin::Configs to describe and alter consumer group configs, e.g. consumer.session.timeout.ms and consumer.heartbeat.interval.ms, which group.protocol: "consumer" (KIP-848) does not take from the client config.
  • [Enhancement] Instrument filtering.expired once per filtering run when Pro expire_in drops messages (count and first/last offset), and log it in the LoggerListener. Messages fetched again (e.g. after a retry) are reported again.
  • [Enhancement] Report librdkafka consumer errors for a partition (e.g. a message that cannot be built, msg_size_too_large) as connection.client.poll.error on error.occurred, with topic, partition and offset in the error details. Consumption does not change.
  • [Enhancement] Publish failed offset commits (also async ones) on error.occurred as connection.client.commit_offsets.error, and successful ones as client.offsets.committed. Results Karafka handles (no_offset, a commit after a lost assignment) are not reported. Requires karafka-rdkafka >= 0.32.3.
  • [Change] Raise UnsupportedOptionError with the Ruby engine name (e.g. jruby) when Swarm runs on a Ruby without Process.fork, also when Swarm::Supervisor#run is called directly, before any work is done.
  • [Change] Require karafka-rdkafka >= 0.32.3, needed to publish successful offset commits as client.offsets.committed.
  • [Change] Require karafka-rdkafka >= 0.32.2: lag and offset reads pass the partition list of Admin#list_consumer_group_offsets as the topic_partition_list: keyword, required since 0.32.1 (0.32.2 is the same code, released with Sigstore attestations).
  • [Change] Require karafka-rdkafka >= 0.32.0. A failed consumer close is now reported as a librdkafka.error on error.occurred instead of being dropped. A close fails in practice only after a fatal error, e.g. when a static membership conflict fenced the consumer. Polling usually reports that error first, so it is reported twice: as connection.client.poll.error and on close.
  • [Change] Fail karafka topics align and migrate (exit 1) when an existing declarative topic has config keys the cluster does not know (e.g. a typo), naming them, instead of skipping them silently. plan lists such keys as unknown and fails too.
  • [Change] Raise Karafka::Errors::ConsumerGroupNotEmptyError when Karafka::Admin changes the offsets of a consumer group with active members, instead of silently leaving them unchanged. With an external consumer client, offsets are read and changed for the queried consumer group, not the client's own.
  • [Change] Apply the routing defaults block to consumer-group topics only. Share-group topics get no defaults, so consumer-group-only calls in it (e.g. config(...), dead_letter_queue) no longer raise NoMethodError when a share group is drawn.
  • [Change] Require karafka-core >= 2.6.8.
  • [Change] Apply strict_declarative_topics to share-group topics too: each one needs an active declaration in declaratives.draw, made before routes.draw.
  • [Change] Add #dispatch_to_dead_letter_queue and, in Pro, #enhance_dead_letter_queue_message as the preferred names of the consumer #dispatch_to_dlq and #enhance_dlq_message. The old names stay supported.
  • [Change] Reject a nil or empty bootstrap.servers (e.g. from an unset ENV variable) when drawing routes, instead of only checking that the key exists. Such a server used to boot and consume nothing. Apps that set it to nil in tests must set a placeholder string.
  • [Maintenance] Foundational work for Kafka share groups (KIP-932) is in progress (routing layer, consumer class hierarchy, config seams). Not usable yet - share groups can be described in routing but cannot run.
  • [Maintenance] 2.6.2.alpha1 was published without a Sigstore attestation because signing failed in the release workflow.
  • [Maintenance] Stop the release when gem signing fails, instead of publishing the gem without a Sigstore attestation.
  • [Fix] [Pro] Do not let healthy KIP-848 (group.protocol=consumer) multiplexed listeners that never received an assignment block dynamic scaling. With more listeners than partitions they stay in the init join state with a rebalance age of 0, so the manager never saw them as stable and kept them alive instead of scaling them down.
  • [Fix] Stop CoordinatorsBuffer#@coordinators from growing unbounded across rebalances by dropping a topic entry on revoke once it tracks no partitions (mirrors PausesManager#delete).
  • [Fix] Use ::JSON.parse in the ActiveJob deserializer, so consuming ActiveJob messages works with the json gem >= 3.0.
  • [Fix] [Pro] Honour the read_committed isolation level in consumer-group lag compensation, so an in-flight transaction no longer overstates the lag (needs karafka-rdkafka >= 0.30.0).
  • [Fix] Run the Karafka::Server.stop sequence once when two stops are requested at the same time (e.g. TERM then INT on JRuby): the state check and the stopping transition are now one atomic step.
  • [Fix] Point the non-Rails karafka.rb install template comment to the karafka install command instead of the non-existent karafka:install.
  • [Fix] Make karafka console explain that the irb gem must be added to the Gemfile, instead of failing with a Bundler error, when irb is not in the bundle (non-Rails apps on Ruby 4.0+).
  • [Fix] Remove the subscription group error callback only after the consumer is closed, so errors reported while closing it (e.g. a failed close) are published via error.occurred.
  • [Fix] Set Message#received_at to the moment each message was polled, not the moment its batch was built, so it no longer trails by up to max_wait_time on low traffic topics (#2292).
  • [Fix] Stop the listener from failing with NoMethodError on JRuby when it checks a subscription group's jobs while workers complete them.
  • [Fix] Stop #inline_insights from returning no data on JRuby while another thread adds or evicts partition statistics.
  • [Fix] Restore InlineInsights::Tracker.exists?, which raised NoMethodError because its delegated #exists? was removed.
  • [Fix] Stop Admin operations from retrying forever when their result never becomes visible. They now raise ResultNotVisibleError after admin.max_retries_duration.
  • [Fix] Keep the Datadog LoggerListener job types cache consistent on JRuby when many workers fill it at once.
  • [Fix] Reset ActiveJob current attributes also when restoring them from the job payload fails part way, so they no longer stay on the worker thread. Attributes the consumer does not declare are now skipped and a non-Hash attributes payload raises Karafka::Errors::InvalidConfigurationError.
  • [Fix] [Pro] Stop an LRJ retry pause from staying paused forever when the listener resumed the partition before the client pause landed.
  • [Fix] [Pro] Validate all four schedule headers of scheduled messages. Only the cancel headers were checked, so a schedule missing schedule_target_topic passed and one missing schedule_target_epoch raised KeyError.
  • [Fix] Stop forceful shutdown from using a listener's client from two threads at once on JRuby. A listener still running after termination now keeps its client open and is reported via connection.listener.shutdown.skipped.
  • [Fix] [Pro] Stop Virtual Partitions on JRuby from raising ConcurrencyError in consumers and resetting the listener when several workers of one partition record processing times at once.
  • [Fix] Stop routing defaults from overwriting a topic's own consumer, kafka, max_messages, max_wait_time, initial_offset and consumer_persistence.
  • [Fix] Stop routing kafka(inherit: true, ...) from changing the given settings hash. A frozen hash raised FrozenError and a hash shared by many topics stopped inheriting the root kafka settings after the first topic.
  • [Fix] Fail karafka topics plan, migrate, align, create, delete, repartition and reset (exit 1) before any change when any declarative topic, also a missing or skipped one, has config keys unknown to the cluster. They now need DescribeConfigs on declared topics with config. With no topic to describe, new topics are checked only when Create is allowed on them.
  • [Fix] In independent DLQ, a message that failed after a recovered one in the same batch saw #attempt 0 and got one retry more than max_retries. In Pro, a custom DLQ strategy: also saw the errors of the recovered message.
  • [Fix] Make the Datadog LoggerListener finish its own job span, not the active one, also on job errors. With dd-trace-rb's Karafka integration active too (e.g. datadog/auto_instrument), jobs nested into one never-ending trace and memory grew without limit. It now warns once when both are active.
  • [Fix] Log lag_compensation.refresher.error in the Datadog LoggerListener through Karafka.logger at warn level, not to stderr via Kernel#warn.
  • [Fix] Treat allow.auto.create.topics as on only when it is true or "true". Any other value (e.g. "false") now reports a missing subscribed topic as an error instead of waiting with a "Waiting for it to be created" log. This includes values librdkafka reads as true, e.g. 1 and "TRUE".
  • [Fix] State the real minimum (10) in the routing max_wait_time validation error. It said "bigger than 0" for values from 1 to 9 that the rule rejects.
  • [Fix] Remove the **args parameter and its documented kafka: option from the top-level routing subscription_group. They never worked: any keyword argument raised a generic ArgumentError. Keyword arguments now raise ArgumentError: no keywords accepted.
  • [Fix] Give each swarm node its own stable transactional.id (<transactional.id>_<node id>, as with group.instance.id), so nodes of a swarm with a transactional default producer no longer fence each other. A swarm with one node keeps the configured id.
  • [Fix] [Pro] Use the producer set in swarm.node.after_fork for scheduled messages and recurring tasks when they use the default producer, instead of the node producer it replaced.
  • [Fix] Reject topics whose names differ only by namespacing style (e.g. a.b and a_b) in one consumer group or share group also when other namespaced topics follow them. With strict_topics_namespacing on, a later namespaced topic without such a collision hid the error.
  • [Fix] Keep topics drawn without an explicit subscription_group in one default subscription group of their consumer group, also when a subscription_group block is drawn between them, so such routes now get fewer subscription groups and Kafka connections. With Pro, those topics also keep the consumer-group-level multiplexing settings.
  • [Fix] [Pro] Keep a topic's own pause(...) over a routing defaults pause(...). Before, the defaults replaced it, also on the Web UI reports topic, the Recurring Tasks schedules topic and Parallel Segments topic copies.
  • [Fix] Make routing and config validation stricter: reject topic, group and client id names spanning many lines, the . and .. topic names, topic names over 249 characters, and topic consumers that are not a class or class name (e.g. an instance), at boot instead of later.
  • [Fix] Stop one idle or slow connection from blocking the Kubernetes liveness and readiness probe server until it closes: read the request line within client_read_timeout (new listener option, 5 seconds by default) and up to 8 KB, then close the connection, so later probes are answered again.
  • [Fix] [Pro] Report a virtual_partitions partitioner that does not respond to #call (e.g. partitioner: :key) as a validation error instead of failing with KeyError, and say that delay_by and expire_in need a positive integer (0 is rejected).
  • [Fix] [Pro] Report an empty swarm nodes (swarm(nodes: []) or swarm(nodes: {})) as a validation error instead of failing with NoMethodError.
  • [Fix] [Pro] Accept a beginless swarm nodes range (e.g. swarm(nodes: ..2)) as starting at node 0 instead of failing with RangeError, as endless ranges (1..) already are.
  • [Fix] [Pro] Unsubscribe again before closing a dynamic multiplexing listener that was scaled down and then scaled up. Before, such a listener skipped the unsubscribe on each later stop.
  • [Fix] [Pro] Do not judge a dynamic multiplexing listener restarted by an upscale on the statistics of its previous consumer. Before, it could be scaled down again at once, before it got an assignment, and cycle between up and down.
  • [Fix] Raise InvalidLicenseTokenError on JRuby for a license token whose ciphertext is not below the public key modulus (e.g. one signed with another key). Before, a Java DataLengthException or ArrayIndexOutOfBoundsException was raised.
  • [Fix] Raise Karafka::Errors::ConsumerGroupNotEmptyError from Karafka::Admin.delete_consumer_group and .rename_consumer_group for a consumer group with active members. rename_consumer_group now fails before it copies any offsets.
  • [Fix] Restart a dead Swarm node once node_restart_timeout (5 s) passes. Before, the restart waited for the next supervision check, up to supervision_interval (30 s), leaving static membership partitions idle for that long.
  • [Fix] [Pro] Pass the topic and partition given to routing filtering.filters to the filter factories. Before, it called them with no arguments and raised ArgumentError for custom ->(topic, partition) filters, required inline insights, parallel segments and expire_in.
  • [Fix] Leave the consumer group on a cooperative-sticky shutdown (classic protocol) also when the group coordinator is slow (about 50 ms or more). Before, the other members got the stopped consumer's partitions only after session.timeout.ms.
  • [Fix] [Pro] Stop a rare can't add a new key into hash during iteration error in #consume when it calls subscription_groups_coordinator.pause.
  • [Fix] Write the default logger lines (e.g. Forceful Karafka server stop with its blocking details) to stdout and log/<env>.log on a forceful shutdown. Before, the forceful exit lost them in log/<env>.log, and in stdout when it was a pipe or a file.
  • [Fix] Make Karafka::Admin.describe_consumer_groups return for consumer group ids with UTF-8 non-ASCII characters. Before, it retried until killed, as librdkafka returns the ids as BINARY.
  • [Fix] [Pro] Raise OpenSSL::PKey::RSAError on JRuby when decrypting a direct mode payload that is not below the private key modulus. Before, a Java DataLengthException or ArrayIndexOutOfBoundsException was raised.
  • [Fix] [Pro] Stop losing subscription groups registered for offset metadata on JRuby when listeners start at the same time. Before, apps with two or more subscription groups could raise KeyError or NoMethodError on every rebalance of an affected subscription group, and #offset_metadata failed for it until restart.
  • [Fix] [Pro] Stop consumer pauses from raising can't add a new key into hash during iteration when lag compensation is on and the listener refreshes the lags of long-paused partitions at the same time. Such a pause was not applied and its batch was processed again.
  • [Fix] [Pro] Stop Virtual Partitions on JRuby from losing errors in errors_tracker (and rarely raising ConcurrencyError instead of the consumer error) when several virtual partitions fail at once, so custom DLQ strategies and collapsed runs that read it see every error.
  • [Fix] [Pro] Say on JRuby that encryption mode: :envelope needs MRI (JRuby-OpenSSL has no OpenSSL::PKey#encrypt/#decrypt) and that :direct mode works, instead of asking for an openssl gem upgrade that cannot help.
  • [Fix] Raise fatal librdkafka poll errors (e.g. fenced_instance_id or, with KIP-848, unreleased_instance_id for a static member) instead of retrying them, so the listener resets the client after reset_backoff. Before, the subscription group kept polling the dead consumer and consumed nothing until the process restarted. With two live processes sharing one group.instance.id, this repeats once per reset_backoff and is reported via error.occurred: with the classic protocol they fence each other in turn; with KIP-848 the newer one is refused and retries while the older one keeps consuming.
  • [Fix] Retry a retryable poll error (e.g. max_poll_exceeded) at least once, even with max_wait_time <= 100 ms or late in a batch, instead of resetting the client and waiting reset_backoff. The retry may run up to about 200 ms past max_wait_time.
  • [Fix] Instrument the registered consumer.idle event on idle runs (e.g. when Pro filtering removed all messages). Report errors raised in the idle flow on error.occurred as consumer.idle.error instead of consumer.wrap.error.

Don't miss a new karafka release

NewReleases is sending notifications on new releases.