static void adjustAutoCommitConfig ( Properties properties , OffsetCommitMode offsetCommitMode ) { if ( offsetCommitMode == OffsetCommitMode . ON_CHECKPOINTS || offsetCommitMode == OffsetCommitMode . DISABLED ) { properties . setProperty ( ConsumerConfig . ENABLE_AUTO_COMMIT_CONFIG , "false" ) ; } }
Make sure that auto commit is disabled when our offset commit mode is ON_CHECKPOINTS . This overwrites whatever setting the user configured in the properties .