我正在尝试将kafka mongo连接器添加到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": "....:}}
.
因此,我无法插入elasticsearchFlume连接器。
有人有解决办法吗?
谢谢您,
弗朗西斯科
暂无答案!
目前还没有任何答案,快来回答吧!