
Baeldung · 7 min readBackend & APIs
Share Consumer Support in Spring Boot for Apache Kafka
Share consumers let multiple Spring Boot listeners read from the same Kafka topic concurrently without partitioning. The guide shows how to configure the ShareConsumerFactory, set acquisition modes, and handle acknowledgements in implicit, explicit, and manual modes. It also demonstrates integration tests verifying concurrent consumption and retry logic.
- Configure SHARE_ACQUIRE_MODE_CONFIG to "record_limit" for single-record polling.
- Use ShareConsumerRecordRecoverer.RELEASING to trigger broker retries.
- Set ShareAckMode.MANUAL to control accept/reject/release per record.