Java Producer Client

Both of these are retriable errors, others non-retriable errors. See the full list of errors and their "retriable" status here: https://kafka.apache.org/protocol#protocol_error_codes

References

Flashcards

Which of the following errors are retriable from a producer perspective? (select two)

What is returned by a producer.send() call in the Java API?:: Future<RecordMetadata> object

When is the onCompletion() method called?

private class ProducerCallback implements Callback {
         @Override
        public void onCompletion(RecordMetadata recordMetadata, Exception e) {
         if (e != null) {
             e.printStackTrace();
            }
        } 
}

    ProducerRecord<String, String> record =
            new ProducerRecord<>("topic1", "key1", "value1");
    producer.send(record, new ProducerCallback()); 

?
When the broker response is received, Callback is invoked when a broker response is received.

Which of the following is true regarding thread safety in the Java Kafka Clients?

What's is true about Kafka brokers and clients from version 0.10.2 onwards?:: A newer client can talk to a newer broker, and an older client can talk to a newer broker. Kafka's new bidirectional client compatibility introduced in 0.10.2 allows this.

What exceptions may be caught by the following producer? (select two)

ProducerRecord<String, String> record =
            new ProducerRecord<>("topic1", "key1", "value1");
    try {
      producer.send(record);
    } catch (Exception e) {
            e.printStackTrace();
}

?

The BufferedExhaustedException in the context of the Java Producer Client library for Apache Kafka is an exception that can be thrown when the producer is unable to send messages due to the internal buffer being full. This typically happens when the producer is producing messages faster than Kafka brokers can handle them, or when there are network or broker issues causing a delay in the acknowledgement of messages.

If you want to modify the behavior of your producer without modifying the code, you should use:: ProducerInterceptor

ProducerInterceptor has what 2 methods?
?