在 Mongo 到 Kafka 连接器上工作并遇到消息从 mongo 转储到 kafka 主题时添加斜杠的问题
rs0:PRIMARY> db.mongotokafka.insert({"key6":"value6"}) –the original data doesn’t have slash
WriteResult({ "nInserted" : 1 })
[azureuser@kafkamongo config]$ kafka-console-consumer.sh --topic mongotokafka.mongotokafka --from-beginning --bootstrap-server localhost:9092
"{\"_id\": {\"$oid\": \"60a89f08ced2363865352271\"}, \"key5\": \"value5\"}" –see the slash
"{\"_id\": {\"$oid\": \"60a89f4d33a3d2ce1af793cb\"}, \"key6\": \"value6\"}"–see the slash