如何修复来自设置为来源的kafka-mongo-connector的消息ID

时间:2019-10-08 09:01:22

标签: mongodb apache-kafka apache-kafka-connect mongodb-kafka-connector

我正在尝试将kafka-mongo-connector添加到kafka-connect来作为事件的来源。我正在这样设置连接器:

{"name": "mongo-source",
  "config": {
    "tasks.max":"1",
    "connector.class":"com.mongodb.kafka.connect.MongoSourceConnector",
    "connection.uri":"mongodb://mongo1:27017,mongo2:27017,mongo3:27017",
    "key.serializer": "org.apache.kafka.common.serialization.JSONSerializer",
    "value.serializer": "org.apache.kafka.common.serialization.JSONSerializer",
    "key.serializer.schemas.enable": "false",
    "value.serializer.schemas.enable": "false",
    "topic.prefix":"mongo",
     "database":"test",
     "collection":"pageviews"
}}' http://localhost:8083/connectors -w "\n"

有数据输入,但密钥采用奇怪的格式:{"_id": {"_data": "....:}}

因此,我无法插入Elasticsearch接收器连接器。

有人解决吗?

谢谢

弗朗切斯科

0 个答案:

没有答案