v4.0.1
listener-readinessDeterministic listener readiness for declared and pattern-matched topics.
Highlights
- 01
Topics exist before listeners start
Topics declared through
@SharedKafkaBroker(topics = ...)are now created during Spring context initialization before listener containers subscribe. - 02
Accurate pattern readiness
Pattern listeners now become ready for a topic only when they have an assignment for that requested matching topic.
Read the guide → - 03
Multiple-listener guidance
The listener readiness docs now explain fan-out with distinct consumer groups and expected competition within one group.
Read the guide → - 04
Correct forbidden-record assertions
Read the guide →noRecordSatisfies(...)now fails when a matching record is present, and records can assert their originating topic withhasTopic(...).
Full notes
Changed
- Bumped the development version to
4.0.1-SNAPSHOTand updated public installation snippets and AI skill packs to targetio.gitlab.guisseppe:spring-kafka-test-utils:4.0.1. - Documented listener readiness for applications with multiple listeners on one topic: distinct consumer groups provide fan-out, while a shared group intentionally competes for partition assignments.
- Added
KafkaRecordAssert.hasTopic(...)for fluent validation of a consumed record's source topic. - Added advanced assertion composition guidance and integration coverage for shared per-record contracts, selected matches, and exact distinct records.
Fixed
- Created topics declared through
@SharedKafkaBroker(topics = ...)during Spring context initialization, before auto-starting@KafkaListenercontainers subscribe, avoiding transientUNKNOWN_TOPIC_OR_PARTITIONretries without changing broker logging setup. - Fixed pattern-based
KafkaTestListenersreadiness so a listener is only ready for the requested matching topic after that topic has an assigned partition, rather than after assignment to a different matching topic. - Fixed
KafkaTopicAssert.noRecordSatisfies(...)so it fails when a candidate record satisfies the forbidden record assertion chain.