Confluent
CCDAK · Question #97
Which of the following is true regarding thread safety in the Java Kafka Clients?
The correct answer is A. One Producer can be safely used in multiple threads C. One Consumer needs to run in one thread. KafkaConsumer is not thread-safe, KafkaProducer is thread safe.
Kafka Client Fundamentals
Question
Which of the following is true regarding thread safety in the Java Kafka Clients?
Options
- AOne Producer can be safely used in multiple threads
- BOne Consumer can be safely used in multiple threads
- COne Consumer needs to run in one thread
- DOne Producer needs to be run in one thread
How the community answered
(69 responses)- A90% (62)
- B4% (3)
- D6% (4)
Explanation
KafkaConsumer is not thread-safe, KafkaProducer is thread safe.
Topics
#thread safety#KafkaProducer#KafkaConsumer#Java client
Community Discussion
No community discussion yet for this question.