nerdexam
Confluent

CCAAK · Question #71

A message written to a Kafka topic results in the creation of a new online shopping order. What is the best method to update the order when a new message is received by Kafka containing a status…

The correct answer is A. Write a Kafka producer that will create a new message based upon the updated order status. Kafka records in a topic are immutable, so you cannot modify or "update" an existing message once it has been written. To update the order status, you publish a new event (a new message) describing the updated status to the topic using a producer; consumers or downstream…

Apache Kafka Fundamentals

Question

A message written to a Kafka topic results in the creation of a new online shopping order. What is the best method to update the order when a new message is received by Kafka containing a status update?

Options

  • AWrite a Kafka producer that will create a new message based upon the updated order status
  • BWrite a Kafka Streams application that can update/modify the order message
  • CWrite a Kafka producer that will locate and update the order message
  • DUse a Kafka connector to update the original order message

How the community answered

(44 responses)
  • A
    80% (35)
  • B
    11% (5)
  • C
    2% (1)
  • D
    7% (3)

Explanation

Kafka records in a topic are immutable, so you cannot modify or "update" an existing message once it has been written. To update the order status, you publish a new event (a new message) describing the updated status to the topic using a producer; consumers or downstream services then derive the current order state by processing the sequence of events for that order.

Topics

#message immutability#producer design#event-driven#order status

Community Discussion

No community discussion yet for this question.

Full CCAAK Practice