package io.github.aelesbao;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.LocalDateTime;
import java.util.Properties;

public class ProducerApp {

    private static final Logger LOGGER = LoggerFactory.getLogger(ProducerApp.class);

    public static void main(String[] args) {

        // Create the Properties class to instantiate the Producer with the desired settings:
        Properties props = new Properties();
        props.put("bootstrap.servers", "0.0.0.0:32806, 0.0.0.0:32810, 0.0.0.0:32808");
        props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
        props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");

        String topic = "my-topic";
        int numberOfRecords = 100; // number of records to send

        try (KafkaProducer<String, String> kafkaProducer = new KafkaProducer<>(props)) {
            for (int i = 0; i < numberOfRecords; i++) {
                String key = String.format("Record-%d", i);
                String message = String.format("Message: %d sent at %s", i, LocalDateTime.now());
                ProducerRecord<String, String> record = new ProducerRecord<>(topic, key, message);
                kafkaProducer.send(record);
                LOGGER.debug("{}", record);

                Thread.sleep(500); // randomize the time between record sends
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

@@ -598,51 +598,22 @@
 %22, %22
-0.0.0.0:32806, 0.0.0.0:32810, 0.0.0.0:32808
+localhost:9092
 %22);%0A
@@ -703,24 +703,24 @@
 rializer%22);%0A
-
         prop
@@ -803,16 +803,674 @@
 lizer%22);
+%0A        props.put(%22acks%22, %221%22);%0A        props.put(%22buffer.memory%22, 33554432);%0A        props.put(%22compression.type%22, %22none%22);%0A        props.put(%22retries%22, 0);%0A        props.put(%22batch.size%22, 16384);%0A        props.put(%22client.id%22, %22%22);%0A        props.put(%22linger.ms%22, 0);%0A        props.put(%22max.block.ms%22, 60000);%0A        props.put(%22max.request.size%22, 1048576);%0A        props.put(%22partitioner.class%22, %22org.apache.kafka.clients.producer.internals.DefaultPartitioner%22);%0A        props.put(%22request.timeout.ms%22, 30000);%0A        props.put(%22timeout.ms%22, 30000);%0A        props.put(%22max.in.flight.requests.per.connection%22, 5);%0A        props.put(%22retry.backoff.ms%22, 5);
 %0A%0A      

Add more settings to producer initialization