Mongo-Kafka source connector change stream return string?


I’m using MongoSourceConnector, to connect a Kafka I’m getting the message on the topic without a problem, but when I wanna try to do a schema-registry from this I’m getting this:


On the schema registry:
curl -X GET http://schema-registry:8081/subjects/mongo.test.pageviews-value/versions/1/schema

Looks if the change stream returns a JSON string, any way to change this to return a JSON?

Driver connector:

    curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d '{
	 "name": "sr-connector-test",
	 "config": {
		"topic.prefix": "sr_topic",
		"": "true"

Connector Status:


Topic returned:
//Always return the msg with double quotes " "
"{"_id": {"_data": {"$binary": "gl5O1i8AARmVwXaNDYq7CWduUosquBA==", "$type": "00"}}, "operationType": "update", "ns": {"db": "name", "coll": "tx"}, "documentKey": {"_id": {"$oid": "5e4de1f01b8406"}}, "updateDescription": {"updatedFields": {"updated": {"$date": 15824943562}}, "removedFields": []}}"

Thanks @Ross_Lawley for you answer, was very helpful.

1 Like

Hi @Ross_Lawley,

I’m currently having similar problems, however I can’t find the issue you refer to.

Do you have any updates regarding this?


My Apologies, please check out KAFKA-124 instead.


Thank you very much @Ross_Lawley, it seems to be exactly what we need to achieve our goal.

Do you have any idea or roadmap on when this would be put into a release? (To be accessed via Confluent Hub for example)


I am creating a demo that leverages this enhancement in addition to the other stuff that will be in 1.3. Here is a link to the demo, The JAR file in the github is just a snapshot build and still in development so don’t use in production. If you have any questions LMK, also if it fits your needs or have suggestions we’d love to know too.