Confluent
CCDAK · Question #101
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…
The correct answer is B. SerializationException D. BufferExhaustedException. These are the client side exceptions that may be encountered before message is sent to the broker, and before a future is returned by the .send() method.
Developing Kafka Producers
Question
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) {
Options
- ABrokerNotAvailableException
- BSerializationException
- CInvalidPartitionsException
- DBufferExhaustedException
How the community answered
(31 responses)- A6% (2)
- B81% (25)
- C13% (4)
Explanation
These are the client side exceptions that may be encountered before message is sent to the broker, and before a future is returned by the .send() method.
Topics
#producer exceptions#SerializationException#BufferExhaustedException#sync vs async send
Community Discussion
No community discussion yet for this question.