2

我正在尝试将 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 接收器连接器。

有人有解决方案吗?

谢谢,

弗朗切斯科

4

0 回答 0