Skip to content
Back to skills

Apache Kafka Knowledge Patch

ASecurity

Apache Kafka

  • 25 stars
  • 0 votes
  • 0 copies
  • 9 views
  • Added September 5, 2026
developmentjavaapisecurityperformance

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill apache-kafka-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Apache Kafka Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Apache Kafka Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-apache-kafka-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-apache-kafka-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: apache-kafka-knowledge-patch
description: Apache Kafka
version: "4.4.0"
license: MIT
metadata:
  author: Nevaberry
---


# Apache Kafka knowledge patch

Use this skill when upgrading Apache Kafka, adapting client or Admin code,
maintaining Connect or MirrorMaker, migrating Kafka Streams, or updating
broker configuration and monitoring. Load the relevant topic reference for
the complete conditions, API changes, and examples.

## Reference index

| Reference | Topics |
| --- | --- |
| [Upgrades and compatibility](references/upgrades-and-compatibility.md) | Upgrade prerequisites, finalization, patch selection, Java, Streams serialization and rollback |
| [Brokers, KRaft, and storage](references/brokers-kraft-and-storage.md) | Controllers, replication, timestamps, retention, tiered storage, coordinator settings |
| [Clients, groups, and security](references/clients-groups-and-security.md) | Producers, consumers, share groups, Admin APIs, OAuth, JAAS, ACLs |
| [Connect, MirrorMaker, and tools](references/connect-mirrormaker-and-tools.md) | CLI migration, plugins, task APIs, worker policies, replication, offset translation |
| [Observability and metrics](references/observability-and-metrics.md) | Logging, JMX, metric migrations, telemetry, broker and Streams monitoring |
| [Kafka Streams](references/streams.md) | Rebalance protocols, topology APIs, exception handlers, state stores, headers, joins, Interactive Queries |

## Upgrade and rollback decisions

Before upgrading KRaft to 4.0, both running software and cluster metadata must
be at least 3.3.x. For an older KRaft cluster, the recommended intermediate
upgrade is 3.9.x before moving to 4.x. Roll brokers one at a time and verify
the cluster before finalizing; 4.0 metadata changes prevent a metadata downgrade.

Kafka 4.2 preserves the metadata format, but a metadata downgrade after
finalization is supported only if every metadata version crossed also
preserves it. Finalizing 4.3 crosses the format-changing `4.3-IV0` boundary
and blocks a metadata downgrade across that boundary.

Upgrade Java clients to at least 2.1 before moving their brokers to 4.0;
upgrade brokers to at least 2.1 before deploying 4.0 Java clients. This also
applies to the Java clients used by Connect and Streams.

- Use 4.2.1 or later for rolling upgrades to 4.2 with transactional producers;
  it fixes a mixed-version issue that could surface as `UnsupportedVersionException`.
- On the Streams 4.1 line, use at least 4.1.1 for the memory-leak and potential
  data-loss fixes. Upgrade Streams applications directly to 4.3.1 for the
  critical native RocksDB leak and stale-offset restart fixes on the 4.3 line.
- Upgrade the Admin client to 4.3.1 to fix partition-leader requests that can
  hang after a cached leader leaves the cluster.

Older Streams versions cannot open a RocksDB store containing the 4.3
`offsets` column family. To downgrade to 4.2 or earlier, stop each instance,
delete its local `state.dir`, and start the older version to restore from
changelogs. Other serialization and RocksDB rollback paths have distinct
conditions in [Upgrades and compatibility](references/upgrades-and-compatibility.md).

## Removed and deprecated configuration and APIs

- Replace `default.deserialization.exception.handler` with
  `deserialization.exception.handler`, and `default.production.exception.handler`
  with `production.exception.handler`.
- Use 4.0.1 or later when migrating from removed `KStream.transformValues()`
  to `processValues()`; it fixes the migration issue tracked in KAFKA-19668.
- Use `org.apache.kafka.streams.AutoOffsetReset` with the new `Topology` and
  `Consumed` overloads in place of deprecated `Topology.AutoOffsetReset`.
- The `kafka-streams-scala` module, including `org.apache.kafka.streams.scala`,
  is deprecated in 4.3 and scheduled for removal in 5.0. Migrate to the Java API.
- Replace deprecated `Admin.listConsumerGroups()` overloads with
  `admin.listGroups(ListGroupsOptions.forConsumerGroups())` for consumer groups.
- Handle `GroupIdNotFoundException` from `Admin.describeConsumerGroups` for
  missing IDs instead of checking for a returned `DEAD` description; use
  `GroupState` instead of `ConsumerGroupState` across group types.
- Use `topicNameValues()` for name-based `DeleteTopicsResult` and
  `DescribeTopicsResult` requests, and `allTopicNames()` instead of
  `DescribeTopicsResult.all()` for those requests.
- Replace `remote.log.manager.thread.pool.size` with
  `remote.log.manager.follower.thread.pool.size`; the follower pool can be resized dynamically.
- `log.cleaner.enable` is deprecated. Keep the cleaner enabled and plan for
  at least one `log.cleaner.threads` when the deprecated setting is removed.
- Kafka 4.4 deprecates `broker.id` and `ClientQuotaCallback.updateClusterMetadata`.

## CLI and extension migrations

Pass multiple endpoints as `--bootstrap-server host1:9092,host2:9092`. Load
bundled KRaft properties from `config/` after the removal of `config/kraft/`.
Remove the formerly inert `--force` option from `kafka-configs.sh` invocations.

For the console producer, replace `--max-partition-memory-bytes` with
`--batch-size`. Replace console `--property` with `--reader-property key=value`
for the producer or `--formatter-property key=value` for console consumers.
These deprecated spellings are scheduled for removal in 5.0.

The [tools reference](references/connect-mirrormaker-and-tools.md) maps the
affected console, performance, verifiable, and administration tools to
`--command-config <file>`, `--command-property key=value`, and `--num-records`.
It also covers reader, decoder, formatter, and Connect callback migrations.

## Monitoring migrations

Kafka 4.0 removes `auto.include.jmx.reporter`; `metric.reporters` includes
`org.apache.kafka.common.metrics.JmxReporter` by default. Rename
`metrics.jmx.whitelist` and `metrics.jmx.blacklist` to `metrics.jmx.include`
and `metrics.jmx.exclude`, respectively.

Use `bufferpool-wait-time-ns-total`, `io-wait-time-ns-total`, and
`io-time-ns-total` in place of `bufferpool-wait-time-total`, `io-waittime-total`,
and `iotime-total`, respectively. Use original topic names in consumer metrics;
Kafka 4.1 also emits the underscore-substituted legacy form until removal in 5.0.

Use the `client-id` tag for `start-time-ms`, `commit-id`, and `version` in
`app-info`; 5.0 removes the untagged forms. The
[metrics reference](references/observability-and-metrics.md) also covers broker
metric renames, MirrorMaker metric migration, Streams ratios, and iterator leaks.

## Consumer and share-group protocols

Finalizing 4.0 automatically enables the new consumer rebalance protocol on
the server. Once a group uses it, broker downgrades have a 3.4.1 floor in
addition to the cluster metadata restrictions.

Share groups are production-ready in 4.2. Use 4.2.1 or later for the deadlock
fix. Before first using share groups on a cluster with fewer than three
brokers, set both properties so Kafka can create `__share_group_state`:

```properties
share.coordinator.state.topic.replication.factor=1
share.coordinator.state.topic.min.isr=1
```

Use `record_limit` share acquisition mode for a strict fetch record limit;
`batch_optimized` treats it as soft. In explicit acknowledgement mode, use
`RENEW` for an in-progress record to extend its acquisition lock.

Share groups can send records they could not process to a dead-letter topic,
copying the original data. Starting offsets can be specified or loaded from a file.

## Transaction and consumer lifecycle handling

Abort the current transaction on `TransactionAbortableException` or on a
timeout during transactional work before commit to avoid duplicates from
retrying the work. For idempotent producers, keep
`max.in.flight.requests.per.connection` at `5` or below; explicitly set
`enable.idempotence=false` if the limit is greater than `5`.

Call `KafkaProducer.flush()` outside send callbacks; Kafka 4.1 rejects calls
from a callback to prevent a deadlock. Use `Consumer.close(CloseOptions)` to
control explicit group departure on shutdown; `Consumer.close(Duration)` is
deprecated. Commit current positions explicitly before `Consumer.unsubscribe()`
to save them, even when auto-commit is enabled.

## Security and client discovery

The JVM property `org.apache.kafka.sasl.oauthbearer.allowed.urls` defaults to
an empty list in 4.0. Set it on every JVM using OAuth token or JWKS endpoints.
Use `org.apache.kafka.allowed.login.modules` to specify permitted JAAS login
modules; `org.apache.kafka.disallowed.login.modules` is deprecated.
Custom `KafkaPrincipalBuilder` implementations must implement principal
serialization and deserialization because it now extends `KafkaPrincipalSerde`.

ACL host patterns support CIDR ranges, including matching through
`Authorizer.authorizeByResourceType`. Kafka resolves symbolic links before
checking paths against `allowed.paths`.

Clients can rebootstrap when metadata updates stall for the timeout or a broker
requests it, even with reachable known brokers. Clients can also wait for
bootstrap names that fail to resolve immediately; `bootstrap.resolve.timeout.ms`
is experimental in 4.4.

## Broker storage and controller operation

With `message.timestamp.type=CreateTime`, Kafka rejects timestamps more than
one hour ahead by default. Adjust `message.timestamp.after.max.ms` on a topic
or `log.message.timestamp.after.max.ms` on a broker. Replace
`log.message.timestamp.difference.max.ms` with separate before/after bounds in 4.0.

Set `cleanup.policy=` for indefinite retention. With `remote.storage.enable=true`,
local segments still follow `log.local.retention.ms` and `log.local.retention.bytes`.
Without tiered storage, `deleteRecords` can still explicitly advance the log start offset.

Set `cordoned.log.dirs` to prevent new partition placement in those directories.
Kafka also honors cordons for explicit replica assignments. If
`controller.quorum.auto.join.enable=true`, shut down a controller before removing
it from the voter set to prevent rejoining; the setting defaults to `false`.

## Streams groups and error handling

The core Streams Rebalance Protocol is production-ready in 4.2. New Streams
groups can be created on 4.2.0; offline migration from classic groups is safe
starting with 4.2.1. The [Streams reference](references/streams.md) preserves the
separate activation, group-identity, and feature limits for early access on 4.1.

Static membership is available with `group.protocol=streams`. Brokers can run
custom task assignors for Streams groups, and the assignor API is in a public module.

With `DefaultProductionExceptionHandler`, set `errors.dead.letter.queue.topic.name`
to forward error records to a dead-letter topic. Custom handlers must build
those records themselves and may ignore the setting. Migrate custom production
handlers to `handleError` and `handleSerializationError`, returning
`ProductionExceptionHandler.Response`.

Set `processing.exception.handler.global.enabled=true` for the configured
`ProcessingExceptionHandler` to handle global store and global KTable failures.
Dead-letter queues are unavailable for this path in 4.3.

## Streams stores, headers, and queries

Set `dsl.store.format=HEADERS` to opt supported DSL operators into header-aware
stores. The configuration accepts `DEFAULT` and `HEADERS`; store-supplier APIs
take `DslStoreFormat.PLAIN`, `TIMESTAMPED`, or `HEADERS`.

Header-aware Processor API stores use matching supplier and builder factories
on `Stores`. Adopt the format in one rolling bounce with the existing changelog
format. RocksDB migrates legacy rows on access, reading empty headers until
rewritten. Clear local store data and restore from changelogs to roll back.
Header retention varies by DSL operator; see the [Streams reference](references/streams.md).

Use `TimestampedKeyWithHeadersQuery` or `TimestampedRangeWithHeadersQuery` for
IQv2 key-value lookups needing headers, and `TimestampedWindowKeyWithHeadersQuery`
or `TimestampedWindowRangeWithHeadersQuery` for timestamped window stores.
When the only queried partition fails, `StateQueryResult.getOnlyPartitionResult()`
returns that failed result; check it before reading its value.

## Connect and MirrorMaker operation

Use `GET /connectors/{connector}/tasks`; Connect 4.0 removes
`GET /connectors/{connector}/tasks-config`. Multiple versions of the same
connector, converter, transformation, or predicate can run on one Connect cluster.
`JsonConverter` accepts an external schema through `schema.content`, and
`ValueToKey` supports nested structures when deriving keys from values.

`MirrorSourceConnector` always uses incremental configuration updates, requiring
target brokers at least 2.3.0. Remove `use.incremental.alter.configs` and
`add.source.alias.to.metrics`; the source alias is always included in metrics.
Use `RemoteClusterUtils.translateOffsets()` for committed offsets from multiple
consumer groups in one call.

Files in this skill

  • SKILL.md10.2 KB
  • coverage.json1 KB
  • references/brokers-kraft-and-storage.md5.7 KB
  • references/clients-groups-and-security.md7.3 KB
  • references/connect-mirrormaker-and-tools.md5.1 KB
  • references/observability-and-metrics.md4.2 KB
  • references/streams.md11.5 KB
  • references/upgrades-and-compatibility.md5.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.