Skip to content

test(binding-kafka): pair the broker-addressed api request application clients with servers - #3215

Merged
jfallows merged 2 commits into
fix/3210-kafka-cache-propagate-affinityfrom
test/3212-kafka-api-broker-application-servers
Nov 15, 2026
Merged

jfallows merged 2 commits into
fix/3210-kafka-cache-propagate-affinityfrom
test/3212-kafka-api-broker-application-servers

Conversation

@jfallows

Copy link
Copy Markdown
Contributor

Description

The application scripts for raw API requests addressed to a broker by affinity (create.topics.v7.broker, .broker.zero, .broker.unknown under streams/application/api) had only a client side, so the application-level spec IT could not run them as a pair. Each now has a server.rpt, and the existing application KafkaCreateTopicsIT has a method per pair: shouldCreateTopicsV3ToBrokerByAffinity, shouldCreateTopicsV3ToBrokerZeroWhenKnown, shouldRejectCreateTopicsV3ToUnknownBroker.

Each server accepts the meta stream and then the API request stream on the same accept address, with two accepted blocks in one script, and serves the partitions the client expects (broker ids 1 and 2, or 0 and 1 for the zero case).

  • .broker and .broker.zero: the API request stream asserts its affinity with read option zilla:affinity ${affinity} (2 and 0, matching the client's script property), then reads the CreateTopics v7 request and writes the response.
  • .broker.unknown: the second stream is rejected, matching the client's connect aborted.

Mirrored pattern

streams/application/produce/message.value/server.rpt: one accept, a first accepted for the meta stream that writes the begin and data extensions, then a second accepted for the other stream. The rejection mirrors produce/topic.missing/server.rpt. The per-stream affinity assertion uses read option zilla:affinity, as in the mqtt-kafka spec scripts, because an accept-level option cannot differ between the two streams. The API request body mirrors create.topics.v7.affinity/server.rpt.

No existing client script was changed, and none violated the protocol.

Fixes #3212

Test evidence

Before the change, the application KafkaCreateTopicsIT had 4 methods and none of the three new ones existed.

Setup: upstream installed with -am -DskipTests -DskipITs -Dskip.checks=true, using system mvn 3.9.11 because the mvnw wrapper could not run here.

  • clean verify -pl specs/binding-kafka.spec -Dit.test=KafkaCreateTopicsIT: application class 7 of 7, network class 11 of 11.
  • Final: mvn -U clean verify -pl specs/binding-kafka.spec,runtime/binding-kafka -Dmaven.build.cache.skipCache=true with checkstyle, license and notice checks on: BUILD SUCCESS.
    • specs/binding-kafka.spec: unit tests 226 run, 0 failures; ITs 475 run, 0 failures, 12 skipped.
    • runtime/binding-kafka: unit tests 229 run, 0 failures; ITs 447 run, 0 failures, 67 skipped; runtime KafkaCreateTopicsIT 13 of 13, which exercises the unchanged client scripts.
  • The first full run failed only on the surefire provider download (ClassNotFoundException: JUnit4Provider) and passed unchanged with -U. license:format produced no further changes.

What I did not run

  • The full reactor and runtime/engine.
  • The examples tests that CI runs with Docker Compose.
  • Anything against a real multi-broker cluster.
  • A check that the skipped ITs were already skipped on develop.

Not delivered

  • The unknown-broker server asserts only that the stream is rejected; it does not read the begin extension or the affinity of the rejected stream, as in produce/topic.missing.

Generated by Claude Code

…n clients with servers

The application scripts create.topics.v7.broker, .broker.zero and
.broker.unknown had only a client side. Add a server.rpt for each, with
the meta stream and the api request stream accepted on one address, and
run each pair in the application KafkaCreateTopicsIT. The servers assert
the affinity of the api request stream with read option zilla:affinity.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SiHVoWg6hhUVBcwYK2kzwC
…ffinity' into test/3212-kafka-api-broker-application-servers
@jfallows
jfallows changed the base branch from develop to fix/3210-kafka-cache-propagate-affinity November 14, 2026 21:02
@jfallows
jfallows added this pull request to stack #3245 November 15, 2026 18:09
@jfallows
jfallows merged commit 7cacd51 into develop Nov 15, 2026
81 checks passed
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.

binding-kafka: add application server scripts for the broker-addressed API request scenarios

2 participants