Skip to content

feat(kafka)!: copy records exactly and declare what a log cannot do - #45

Merged
sudoitir merged 15 commits into
mainfrom
claude/log-copy-and-exact-records
Dec 5, 2026
Merged

sudoitir merged 15 commits into
mainfrom
claude/log-copy-and-exact-records

Conversation

@sudoitir

@sudoitir sudoitir commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Kafka can now copy records exactly, and the SDK says honestly what a log can and cannot do.

  • A record's headers are kept as read (order, duplicates, binary and null values) and an unchanged copy writes them back verbatim. A changed copy is encoded afresh.
  • OutboundMessage.copyOf refuses a message whose body was cut.
  • COPY_MESSAGES is declared on topics and partitions: bulk(ById, Copy) copies within a connection (up to 1,000 refs), reports offsets that hold no record as not done, and refuses filter and all selections.
  • Move and delete stay unavailable on a log, with a reason that names only those two verbs.
  • A share group reports its dead-letter topic (errors.deadletterqueue.topic.name) in one batched configuration read.
  • TCK: a copy by id leaves the source and reproduces the message; a message copied across two connections is reproduced exactly (Kafka compares raw headers).

ADR-0044 records the decision.

BREAKING CHANGE: OutboundMessage.copyOf throws IllegalArgumentException for a truncated message.

Verification: narrow unit tests pass locally; the build, the TCK and japicmp run on CI.

🤖 Generated with Claude Code

dependabot Bot and others added 14 commits December 1, 2026 08:54
Bumps the actions group with 1 update in the / directory: [actions/setup-java](https://github.com/actions/setup-java).


Updates `actions/setup-java` from 6.2.0 to 6.3.0
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@77dd5b2...d1374f8)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
… 14 updates

Bumps the maven-minor-patch group with 14 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| org.apache.avro:avro | `1.11.5` | `1.12.2` |
| [org.jetbrains.kotlin:kotlin-stdlib](https://github.com/JetBrains/kotlin) | `2.0.20` | `2.4.21` |
| [com.squareup.okio:okio-jvm](https://github.com/lysine-dev/okio) | `3.10.2` | `3.18.2` |
| io.apicurio:apicurio-registry-protobuf-schema-utilities | `3.0.8` | `3.3.6` |
| [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) | `5.37.1` | `5.38.0` |
| [tools.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) | `3.2.4` | `3.3.0` |
| [org.mockito:mockito-core](https://github.com/mockito/mockito) | `5.24.0` | `5.25.0` |
| [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) | `3.11.0` | `3.12.0` |
| [com.github.siom79.japicmp:japicmp-maven-plugin](https://github.com/siom79/japicmp) | `0.27.0` | `0.28.0` |
| [org.springframework:spring-core](https://github.com/spring-projects/spring-framework) | `7.0.10` | `7.1.0` |
| [org.springframework.boot:spring-boot-dependencies](https://github.com/spring-projects/spring-boot) | `4.1.2` | `4.2.0` |
| [org.springframework.boot:spring-boot-configuration-processor](https://github.com/spring-projects/spring-boot) | `4.1.2` | `4.2.0` |
| [org.springframework.boot:spring-boot-configuration-processor](https://github.com/spring-projects/spring-boot) | `4.1.2` | `4.2.0` |
| org.apache.commons:commons-lang3 | `3.21.0` | `3.22.0` |
| org.apache.maven:apache-maven | `3.10.0` | `3.10.2` |



Updates `org.apache.avro:avro` from 1.11.5 to 1.12.2

Updates `org.jetbrains.kotlin:kotlin-stdlib` from 2.0.20 to 2.4.21
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](JetBrains/kotlin@v2.0.20...v2.4.21)

Updates `com.squareup.okio:okio-jvm` from 3.10.2 to 3.18.2
- [Changelog](https://github.com/lysine-dev/okio/blob/main/CHANGELOG.md)
- [Commits](lysine-dev/okio@3.10.2...parent-3.18.2)

Updates `io.apicurio:apicurio-registry-protobuf-schema-utilities` from 3.0.8 to 3.3.6

Updates `com.rabbitmq:amqp-client` from 5.37.1 to 5.38.0
- [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases)
- [Commits](rabbitmq/rabbitmq-java-client@v5.37.1...v5.38.0)

Updates `tools.jackson:jackson-bom` from 3.2.4 to 3.3.0
- [Commits](FasterXML/jackson-bom@jackson-bom-3.2.4...jackson-bom-3.3.0)

Updates `org.mockito:mockito-core` from 5.24.0 to 5.25.0
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v5.24.0...v5.25.0)

Updates `com.diffplug.spotless:spotless-maven-plugin` from 3.11.0 to 3.12.0
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](diffplug/spotless@maven/3.11.0...maven/3.12.0)

Updates `com.github.siom79.japicmp:japicmp-maven-plugin` from 0.27.0 to 0.28.0
- [Release notes](https://github.com/siom79/japicmp/releases)
- [Changelog](https://github.com/siom79/japicmp/blob/master/release.py)
- [Commits](siom79/japicmp@japicmp-base-0.27.0...japicmp-base-0.28.0)

Updates `org.springframework:spring-core` from 7.0.10 to 7.1.0
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](spring-projects/spring-framework@v7.0.10...v7.1.0)

Updates `org.springframework.boot:spring-boot-dependencies` from 4.1.2 to 4.2.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v4.1.2...v4.2.0)

Updates `org.springframework.boot:spring-boot-configuration-processor` from 4.1.2 to 4.2.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v4.1.2...v4.2.0)

Updates `org.springframework.boot:spring-boot-configuration-processor` from 4.1.2 to 4.2.0
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v4.1.2...v4.2.0)

Updates `org.apache.commons:commons-lang3` from 3.21.0 to 3.22.0

Updates `org.apache.maven:apache-maven` from 3.10.0 to 3.10.2

---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-version: 3.12.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: com.github.siom79.japicmp:japicmp-maven-plugin
  dependency-version: 0.28.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: com.rabbitmq:amqp-client
  dependency-version: 5.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: com.squareup.okio:okio-jvm
  dependency-version: 3.18.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: io.apicurio:apicurio-registry-protobuf-schema-utilities
  dependency-version: 3.3.6
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.apache.avro:avro
  dependency-version: 1.12.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.apache.commons:commons-lang3
  dependency-version: 3.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.apache.maven:apache-maven
  dependency-version: 3.10.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-version: 2.4.21
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.mockito:mockito-core
  dependency-version: 5.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.springframework.boot:spring-boot-configuration-processor
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.springframework.boot:spring-boot-configuration-processor
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.springframework.boot:spring-boot-dependencies
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: org.springframework:spring-core
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
- dependency-name: tools.jackson:jackson-bom
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BREAKING CHANGE: OutboundMessage.copyOf throws IllegalArgumentException for a message read with a body cap smaller than its body. Read the message again with a larger cap before copying.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…opy as read

A message read from Kafka carries its record's headers in the kafka extension under headers: every header, in order, duplicates kept, any bytes, null kept. A copy sent unchanged is written with them verbatim; a copy whose neutral headers or properties changed is encoded afresh.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ilable only

Topics and partitions declare COPY_MESSAGES. bulk with a by-id selection and a copy action reads each named record and writes it to another topic or partition of the connection, at most 1,000 per call; an offset that holds no record is reported as not done. A selection by filter or of everything is refused. The access probe reports copy as not tried, and move and delete as unavailable because a log cannot remove a record.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A share group that names errors.deadletterqueue.topic.name reports it as StandardAttributes.DEAD_LETTER. The setting is read for a page of groups in one describeConfigs; a configuration that cannot be read leaves the attribute out and does not fail the listing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
aCopyLeavesTheSourceAndReproducesTheMessage runs for every kind that declares COPY_MESSAGES. aMessageCopiedAcrossTwoConnectionsIsReproducedExactly reads on one connection and sends copyOf on another, and compares through TckEnvironment.nativeEquals, which a driver overrides to compare its native data. seedNativeMessages lets a driver write records a neutral send cannot, and the Kafka environment writes a repeated header, non-text bytes, a null header value and a tombstone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ticks the TCK and documents tasks of log-copy-and-exact-records.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rget

A copy that fails or is in doubt partway no longer reports nothing done: it
returns the records acknowledged and names every other one as not done, with
why, so a retry does not blindly duplicate. References must name the source
(or, for a partition source, its topic with that partition), and a target
partition outside the target topic is refused. The TCK copy tests assume the
browse verb and tolerate properties a driver adds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… a broker without it

A cancelled wait for a producer acknowledgement now counts that write and every one after it as
in doubt instead of refused, and the interrupt flag stays set. The TCK copy case skips when the
environment says the system of the run lacks the operation, which the Artemis run uses for
brokers without copyMessage. A long product is widened before the multiplication.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3.3.x needs protobuf 4.x (com.google.protobuf.GeneratedFile) and fails the
schema encode tests on the protobuf 3.25 pin. The other dependency bumps stay.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 5, 2026

Copy link
Copy Markdown

@sudoitir
sudoitir merged commit bc31efa into main Dec 5, 2026
54 of 60 checks passed
@sudoitir
sudoitir deleted the claude/log-copy-and-exact-records branch December 5, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant