Docs Home → MongoDB Kafka Connector
Converters
On this page
Overview
This guide describes how to use converters with the MongoDB Kafka Connector. Converters are programs that translate between bytes and Kafka Connect's runtime data format.
Converters pass data between Kafka Connect and Apache Kafka. The MongoDB Kafka Connector passes data between MongoDB and Kafka Connect. The following diagram shows these relationships:
To learn more about converters, see the following resources:
Available Converters
As the MongoDB Kafka Connector converts your MongoDB data into Kafka Connect's runtime data format, the MongoDB Kafka Connector works with all available converters.
Important
Use the Same Converter for your Source and Sink Connectors
You must use the same converter in your source and sink connectors. For example, if your source connector writes to a topic using Protobuf, your sink connector must use Protobuf to read from the topic.
To learn what converter to use, see this page from Confluent.
Converters with Schemas
If you use a schema-based converter such as the converter for Avro, Protobuf, or JSON Schema, you should define a schema in your MongoDB Kafka Connector source connector.
To learn how to specify a schema, see the Apply Schemas guide.
Connector Configuration
This section provides templates for properties files to configure the following converters in a MongoDB Kafka Connector pipeline:
Avro Converter
Click the following tabs to view properties files that work with the Avro converter:
To use the preceding properties file, replace the placeholder text in angle brackets with your information.
Protobuf Converter
Click the following tabs to view properties files that work with the Protobuf converter:
To use the preceding properties file, replace the placeholder text in angle brackets with your information.
JSON Schema Converter
Click the following tabs to view properties files that work with the JSON Schema converter:
To use the preceding properties file, replace the placeholder text in angle brackets with your information.
JSON Converter
Click the following tabs to view properties files that work with the JSON converter:
To use the preceding properties file, replace the placeholder text in angle brackets with your information.
String Converter (Raw JSON)
Click the following tabs to view properties files that work with the String converter:
To use the preceding properties file, replace the placeholder text in angle brackets with your information.