fx19880617 opened a new issue #6480:
URL: https://github.com/apache/incubator-pinot/issues/6480


   Seeing more requirements on this.
   
   Kafka consumer supports exact-once semantics but requires code changes.
   Code snippet:
   ```
   KafkaConsumer consumer = createKafkaConsumer(
     "bootstrap.servers", "localhost:9092",
     "group.id", "my-group-id",
     "isolation.level", "read_committed");
   consumer.subscribe(singleton("inputTopic"));
   while (true) {
     ConsumerRecords records = consumer.poll(Long.MAX_VALUE);
     producer.beginTransaction();
     for (ConsumerRecord record : records)
       producer.send(producerRecord("outputTopic", record));
     producer.sendOffsetsToTransaction(currentOffsets(consumer), group);  
     producer.commitTransaction();
   }
   ```
   
   We can add a config in kafka-2.0 plugin and switch the code path.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to