CCDAK practice question 20 of 25

A Kafka producer application wants to send log messages to a topic that does not include any key. What are the properties that are mandatory to configure for the producer configuration? (select three)

Full set: 150 questions
Answer options
A: bootstrap.servers Correct answer
B: partition
C: key.serializer Correct answer
D: value.serializer Correct answer
E: key
F: value
Correct Answer:
A. bootstrap.servers; C. key.serializer; D. value.serializer
Explanation

To instantiate a KafkaProducer client, three configuration properties are mandatory. bootstrap.servers provides the initial list of brokers for the producer to connect to the Kafka cluster. value.serializer is required to convert the message's value object into a byte array for transmission. Crucially, key.serializer is also mandatory, even if the messages being sent have a null key. The producer's configuration validation requires a serializer for both the key and the value, regardless of the content of any specific message. Without these three properties, the producer client will fail to initialize.

Why Incorrect

B. partition: This is an optional parameter of a ProducerRecord object, not a mandatory producer-level configuration property.
E. key: This is the data for an individual message's key, passed within a ProducerRecord, not a producer configuration.
F. value: This is the data for an individual message's value, passed within a ProducerRecord, not a producer configuration.

References

1. Apache Kafka Documentation (3.7): The official documentation for producer configurations explicitly lists bootstrap.servers, key.serializer, and value.serializer as required.

Source: Apache Kafka Documentation, Section 3.4 "Producer Configs".

Reference: The configuration tables for bootstrap.servers, key.serializer, and value.serializer all have a "Required" flag set to "true".

2. Confluent Documentation: The Confluent documentation reinforces this by identifying the same three properties as the minimum required configuration for a producer.

Source: Confluent Documentation, "Producers in Apache Kafka®".

Reference: In the "Required Producer Configurations" section, it states: "The minimum required configuration for a producer consists of three properties: bootstrap.servers, key.serializer, and value.serializer."

Scroll to Top