CCAAK · Question #72
Several applications are producing messages with different compression formats to a single Kafka topic that has multiple partitions. How will consuming applications become aware of the different…
The correct answer is D. Producers will indicate the compression type in the header of each message. In Kafka, each producer can choose a compression format (e.g., gzip, snappy, lz4, zstd, or none) when sending messages. This compression type is specified by the producer in the producer When messages are sent to Kafka, the compression type is stored in the message's metadata…
Question
Several applications are producing messages with different compression formats to a single Kafka topic that has multiple partitions. How will consuming applications become aware of the different compression formats used by each producer?
Options
- AThis is not possible, because each Kafka topic requires all of its partitions to have the same
- BBrokers will write each message into the partition that matches the producer's compression type
- CBrokers will record the compression type of each message in an internal Kafka topic
- DProducers will indicate the compression type in the header of each message
How the community answered
(42 responses)- A10% (4)
- B2% (1)
- C5% (2)
- D83% (35)
Explanation
In Kafka, each producer can choose a compression format (e.g., gzip, snappy, lz4, zstd, or none) when sending messages. This compression type is specified by the producer in the producer When messages are sent to Kafka, the compression type is stored in the message's metadata. This allows consuming applications to correctly handle and decompress the messages when they are read. Kafka does not impose a restriction that all messages in a partition must have the same compression type. Therefore, different messages in the same partition can use different compression formats, and the consuming applications will be able to decode each message correctly based on the compression type indicated by the producer.
Topics
Community Discussion
No community discussion yet for this question.