title: How to implement Processor API with Exactly-once mode
body: <p>I'm studying Kafka Stream and using Processor API to implement my use case. The code below shows the Process method which forwards a message downstream and aborts before calling <code>commit</code>. This causes the stream to be reprocessed and duplicates the message on the Sink.</p>
  
  <pre><code>public void process(String key, String value) {
  
      context.forward(key, value);
  
      .. 
      ..
      //killed
  
      context.commit();
  }
  </code></pre>
  
  <p>processing.guarantee parameter:</p>
  
  <pre><code>streamsConfiguration.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, StreamsConfig.EXACTLY_ONCE);
  </code></pre>
  
  <p>Is there a way to apply the forwarding only when invoking <code>commit</code> statement. If not, what is the correct approach to implement Exactly-once mode.</p>
  
  <p>Thank you</p>