Open yingbo-wu opened 3 years ago
In addition, it is escaped as + when the setting contains Spaces
{
"camel.source.endpoint.streamFilter": "{$match: {operationType: {$in: ['insert', 'update', 'replace']}}}"
}
The log is: MongoDb endpoint: mongodb://mongo?collection=test_object&consumerType=changeStreams&database=ac-test&mongoConnection=%23class%3Acom.mongodb.client.MongoClients%23create%28%27mongodb%3A%2F%2Froot%3Aroot%40192.168.23.164%3A27017%2F%3FauthSource%3Dadmin%27%29&streamFilter=%7B%24match%3A+%7BoperationType%3A+%7B%24in%3A+%5B%27insert%27%2C+%27update%27%2C+%27replace%27%5D%7D%7D%7D
The decode is MongoDb endpoint: mongodb://mongo?collection=test_object&consumerType=changeStreams&database=ac-test&mongoConnection=#class:com.mongodb.client.MongoClients#create('mongodb://root:root@192.168.23.164:27017/?authSource=admin')&streamFilter={$match:+{operationType:+{$in:+['insert',+'update',+'replace']}}}
@yingbo-wu as you correctly reported this is a camel component issue, I have taken the liberty to open an issue about it https://issues.apache.org/jira/browse/CAMEL-16716
The camel.source.endpoint.streamFilter Setting an incorrect JSON format does not result in an exception So my guess is that this setting doesn't work
In the end I surmised that it was the Camel-MongoDB component problem The following is part of the Camel-MongoDB code org/apache/camel/component/mongodb3/MongoDbChangeStreamsConsumer.java
The camel.source.endpoint.streamFilter is URI parameters But camel-mongodb Is to read content from properties Whether the Camle-Mongo component has an incompatible connector configuration