DP-420 practice question 13 of 25

You need to configure an Apache Kafka instance to ingest data from an Azure Cosmos DB Core (SQL) API account. The data from a container named…

Full set: 144 questions
You need to configure an Apache Kafka instance to ingest data from an Azure Cosmos DB Core (SQL) API account. The data from a container named telemetry must be added to a Kafka topic named iot. The solution must store the data in a compact binary format. Which three configuration items should you include in the solution? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
Answer options
A: "connector.class": "com.azure.cosmos.kafka.connect.source.CosmosDBSourceConnector" Correct answer
B: "key.converter": "org.apache.kafka.connect.json.JsonConverter"
C: "key.converter": "io.confluent.connect.avro.AvroConverter" Correct answer
D: "connect.cosmos.containers.topicmap": "iot#telemetry" Correct answer
E: "connect.cosmos.containers.topicmap": "iot"
F: "connector.class": "com.azure.cosmos.kafka.connect.source.CosmosDBSinkConnector"
Correct Answer:
A. "connector.class": "com.azure.cosmos.kafka.connect.source.CosmosDBSourceConnector"; C. "key.converter": "io.confluent.connect.avro.AvroConverter"; D. "connect.cosmos.containers.topicmap": "iot#telemetry"
Explanation

You need a source connector (reads from Cosmos DB and writes to Kafka), map the container telemetry to topic iot, and serialize the messages in a compact binary format such as Avro. Consequently:
• connector.class must be com.azure.cosmos.kafka.connect.source.CosmosDBSourceConnector.
• connect.cosmos.containers.topicmap must bind iot to telemetry: "iot#telemetry".
• key.converter (and value.converter) should use io.confluent.connect.avro.AvroConverter to emit Avro-encoded, compact messages.

Why Incorrect

B Uses JsonConverter – JSON is not a compact binary format. E Topic map lacks container mapping, so no telemetry data is ingested. F SinkConnector is for writing into Cosmos DB, not reading from it.

References

1. Microsoft Docs – “Azure Cosmos DB Kafka Connector (source)”

Configuration properties table

connector.class & containers.topicmap (https://learn.microsoft.com/azure/cosmos-db/kafka-connector#source-configuration).

2. Confluent Docs – “Avro Converter”

Section ‘Why Avro’ (https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html).

3. Apache Kafka Connect – Converter overview

§ Binary formats (https://kafka.apache.org/documentation/#connect).

Scroll to Top