v5.2.0
queuesKafka share groups (KIP-932) join the harness: test queue-style listeners next to classic, batch and retryable ones, with readiness, seeding, bean overrides and cleanup all handling both kinds.
Highlights
- 01
Share listeners, tested like any other
A
Read the guide →ShareKafkaListenerContainerFactorylistener (Spring for Apache Kafka 4.1, Kafka 4.2) works next to classic ones in the same application. The embedded broker starts with the twoshare.coordinator.state.topic.*settings a one-node broker needs, without which the coordinator cannot create its state topic and share consumers silently receive nothing.wiretap.test.broker-properties.<kafka.property>passes further broker settings through. - 02
Readiness that knows the difference
Read the guide →KafkaTestListeners.ListenerStatusgainskind()(CLASSICorSHARE) andmembers(). A share container is ready when it runs with at least one share-group member holding an assignment, read throughdescribeShareGroupsrather thangetAssignedPartitions(), which share containers do not support. Mixed registries are judged one container at a time, so one share listener no longer breaksawaitAllReady()for the whole context. - 03
Bean overrides, seeds and cleanup, for queues too
With bean overrides on, a
Read the guide →DefaultShareConsumerFactoryis retargeted at the test broker (rebuilt when it carries production security keys), share group ids get the per-context suffix, and every suffixed share group is set toshare.auto.offset.reset=earliestbefore its containers start, so seeds and pre-fetch publishes are visible. Per-method cleanup deletes share groups by type under the same suffix rule. - 04
Passthrough that checks the cluster
In passthrough mode, a context that declares a share factory or container verifies the cluster's finalized
Read the guide →share.versiononce and fails with thekafka-features.shremedy when it is missing, never changing cluster features itself. The differential evaluation lane runs a share-group corpus against real Kafka 4.2, skipping it with a logged reason on brokers without the feature.
Full notes
Added
- Share-group (KIP-932) listener support alongside classic, batch and retryable listeners. Embedded broker starts with
share.coordinator.state.topic.replication.factor=1andshare.coordinator.state.topic.min.isr=1;wiretap.test.broker-properties.<kafka.property>passes further broker settings (first context wins, ignored in passthrough). KafkaTestListeners.ListenerStatus.kind()(CLASSIC/SHARE) andmembers(); share containers are judged ready by share-group membership, and the readiness failure table gainskindandmemberscolumns. Mixed classic-and-share registries are handled in one pass.- Bean overrides adjust share factories: a
DefaultShareConsumerFactoryis retargeted (rebuilt with a sanitised config when it carries production security), aShareKafkaListenerContainerFactorygets the group-id suffix, andwiretap.test.bean-overrides.share.auto-offset-reset(defaultearliest) is written to each suffixed share group before its containers start. - Passthrough
share.versionpreflight for contexts that declare share beans; per-method cleanup deletes share groups throughdeleteShareGroupsunder the suffix rule; a G7 share-group differential corpus and a three-image CI matrix (Kafka 3.9.1, 4.0.0, 4.2.1).
Fixed
- One share-group listener no longer breaks
awaitAllReady(),awaitListenersForTopic(...),listenersForTopic(...)andhasReadyListeners()for every listener in the context; readiness no longer callsgetAssignedPartitions()on share containers, which throwUnsupportedOperationException.