I would like to know what happens to the already polled events on a gracefull shutdown eg. a SIGTERM was received.
- All events from the poll will be handled and the offset will be commited, bindings will be unregistered
- The current event will be handled, the offset committed and the remaining events discarded, bindings will be unregistered
- ?
If option one is the case, what would be the best/simplest solution to implement the option two behaviour? We use manual acks.
For example: Implement the SmartLifecyle interface where we ack our events and react to a flag which will be set in the stop() methode which causes a .nack(0) call (discard all remaining events) while processing the next event. The next poll should not happen due to the isRunning() condidion in KafkamessageListenerContainer#970 which will be set to false through the lifecycle interface
Versions:
Spring Boot 2.3.1, Spring Cloud Horsham.SR6 (Spring Cloud Starter Stream Kafka 3.0.6)
Thanks!