title: Kafka Connect with MongoDB Connector
body: <p>I have tried to use Apache Kafka Connect with MongoDB sink connector (<a href="https://github.com/DataReply/kafka-connect-mongodb/tree/master/src/main/java/org/apache/kafka/connect" rel="nofollow noreferrer">connector</a>)</p>
  
  <p>When I used Avro format it worked except of one issue, I had to create the topic with one partition because the connector uses record.kafkaOffset() for the _id of the new Mongo record (so with multi partitions I get the same id for different records). </p>
  
  <p>How can I fix it?</p>
  
  <p>I would like to test it with Json so I created a new topic for that. And changed the converter configurations to JsonConverter. When I run it I get the following error:</p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.util.HashMap cannot be cast to org.apache.kafka.connect.data.Struct
            at org.apache.kafka.connect.mongodb.MongodbSinkTask.put(MongodbSinkTask.java:106)
            at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:280)
            at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:176)
            at org.apache.kafka.connect.runtime.WorkerSinkTaskThread.iteration(WorkerSinkTaskThread.java:90)
            at org.apache.kafka.connect.runtime.WorkerSinkTaskThread.execute(WorkerSinkTaskThread.java:58)
            at org.apache.kafka.connect.util.ShutdownableThread.run(ShutdownableThread.java:82)</p>
  </blockquote>
  
  <p>Does this connector work with Json?</p>