Kafka-connect mongodb sink connector

I have installed confluent platform and installed mogodb connector in java folder and added plugin path. Then, started to running the services such as zookeeper, kafka, schema-registry, rest and distributed connector. my sink properties file configurations are,
name=mongodb-sink-data

topics=newtopic

connector.class=com.mongodb.kafka.connect.MongoSinkConnector

tasks.max=1

connection.uri=mongodb://localhost:27017,localhost:27027/?replicaSet=rs0

database=NEWDB

key.converter=io.confluent.connect.avro.AvroConverter

key.converter.schema.registry.url=http://localhost:8081

value.converter=io.confluent.connect.avro.AvroConverter

value.converter.schema.registry.url=http://localhost:8081

value.converter.shemas.enable=true

key.converter.shemas.enable=true

output.format.key=schema

output.format.value=schema

output.schema.key=schema

output.schema.value=schema

output.schema.infer.value=true

document.id.strategy=com.mongodb.kafka.connect.sink.processor.id.strategy.BsonOidStrategy

post.processor.chain=com.mongodb.kafka.connect.sink.processor.DocumentIdAdder

I have got error 422- Unrecognized field error. I have attached postman request and error screenshot,


Please guide me what i did wrong

I believe you have properties that are part of the source connector, not sink connector in your configuration.

output.format.key – The output format of the data produced by the connector for the value and that is documented in the source config (not the sink).

I find the MongoSourceConfig and MongoSinkConfig classes in the connector the best way to validate config – there is also the validate you can do on a configuration from the RESTful api.

If I am not adding those configurations also it gave same error

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.