Я хочу использовать Debezium для получения данных об изменениях MongoDB и записи данных в Kafka. Но когда я использую эту команду
bin/connect-standalone.sh config/connect-standalone.properties mongo.properties
Существует ClassCastException。
[2019-01-06 21:17:54,103] INFO Setting max election id to 7fffffff0000000000000001 from replica set primary localhost:27017 (org.mongodb.driver.cluster:71)
[2019-01-06 21:17:54,103] INFO Setting max set version to 1 from replica set primary localhost:27017 (org.mongodb.driver.cluster:71)
[2019-01-06 21:17:54,104] INFO Discovered replica set primary localhost:27017 (org.mongodb.driver.cluster:71)
[2019-01-06 21:17:54,186] INFO Opened connection [connectionId{localValue:4, serverValue:10}] to localhost:27017 (org.mongodb.driver.connection:71)
[2019-01-06 21:17:54,316] INFO Checking shard details from configuration replica set rs0/127.0.0.1:27017 (io.debezium.connector.mongodb.ReplicaSetDiscovery:68)
[2019-01-06 21:17:54,332] ERROR Error while trying to get information about the replica sets (io.debezium.connector.mongodb.ReplicaSetMonitorThread:85)
java.lang.ClassCastException: org.bson.types.ObjectId cannot be cast to java.lang.String
at org.bson.Document.getString(Document.java:215)
at io.debezium.connector.mongodb.ReplicaSetDiscovery.lambda$getReplicaSets$0(ReplicaSetDiscovery.java:69)
at io.debezium.connector.mongodb.MongoUtil.lambda$onCollectionDocuments$1(MongoUtil.java:152)
at io.debezium.connector.mongodb.MongoUtil.lambda$onCollection$0(MongoUtil.java:131)
at io.debezium.connector.mongodb.MongoUtil.onDatabase(MongoUtil.java:115)
at io.debezium.connector.mongodb.MongoUtil.onCollection(MongoUtil.java:129)
at io.debezium.connector.mongodb.MongoUtil.onCollectionDocuments(MongoUtil.java:148)
at io.debezium.connector.mongodb.ReplicaSetDiscovery.getReplicaSets(ReplicaSetDiscovery.java:67)
at io.debezium.connector.mongodb.ReplicaSetMonitorThread.run(ReplicaSetMonitorThread.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Мои деньги.
name=inventory-connector
connector.class=io.debezium.connector.mongodb.MongoDbConnector
mongodb.hosts=rs0/127.0.0.1:27017
mongodb.name=fullfillment
collection.whitelist=inventory.test
Я впервые строю. Пожалуйста, помогите мне. Большое спасибо.