how to ensure messages are not lost using the spring KafkaMessageListenerContainer.java
<p>Once I receive a message from kafka I need to run a long running process ( which takes at most 20 seconds), I need to consider a message as successful only if this process completes.</p>

<p>Also I need to ensure that each message is processed at least once.</p>

<p>Thinking of using the KafkaMessageListenerContainer with the following properties:</p>

<ol>
<li><p>ThreadPoolTaskExecutor for the listenerTaskExecutor  </p></li>
<li><p>Using a MessageListener of type AcknowledgingMessageListener </p></li>
<li><p>Setting the Acknowledge mode as MANUL_IMMEDIATE.</p></li>
</ol>

<p>But the only question I have is what happens if the particular message with offset say 15 is processed successfully first , but message with 14 is still being processed. So in this case my offset will be updated to 15 , even though 14 is not yet processed </p>

<p>How to handle these kind of situations?</p>