Complete the code to enable exactly-once processing in Kafka Streams.
Properties props = new Properties();
props.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, [1]);Setting PROCESSING_GUARANTEE_CONFIG to "exactly_once" enables exactly-once semantics in Kafka Streams.
Complete the code to commit Kafka Streams transactions for exactly-once processing.
KafkaStreams streams = new KafkaStreams(builder.build(), props);
streams.[1]();The start() method begins the Kafka Streams application and manages transactions for exactly-once processing.
Fix the error in the code to enable exactly-once processing with idempotent producer.
props.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, [1]);The value must be a string "true" to correctly configure the producer for idempotence in Kafka Streams properties.
Fill both blanks to create a transactional producer with exactly-once semantics.
props.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, [1]); props.put(ProducerConfig.ACKS_CONFIG, [2]);
Setting a unique TRANSACTIONAL_ID_CONFIG enables transactions, and ACKS_CONFIG set to "all" ensures full commit acknowledgment for exactly-once.
Fill all three blanks to configure Kafka Streams for exactly-once processing with proper commit interval and retries.
props.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, [1]); props.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, [2]); props.put(ProducerConfig.RETRIES_CONFIG, [3]);
Exactly-once processing requires PROCESSING_GUARANTEE_CONFIG set to "exactly_once", a commit interval of 1000 ms for timely commits, and retries set to 5 for robustness.