See https://stackoverflow.com/questions/72296135/thread-sleep-in-the-kafka-listener/72296671#72296671 Perhaps the container can use a similar mechanism to the new error handler to keep the remaining records in memory.