bthj edited a comment on issue #2684:
URL: https://github.com/apache/camel-k/issues/2684#issuecomment-939052651


   The [MongoClient does seem to have been 
refactored](https://stackoverflow.com/questions/60267087/differences-between-com-mongodb-client-mongoclient-and-com-mongodb-mongoclient),
 and it seems I should be referencing `com.mongodb.client.MongoClient` instead 
of `com.mongodb.MongoClient`, where the former is an interface.  So probably I 
should [configure a singleton bean by its 
type](https://camel.apache.org/components/latest/others/main.html#_configuring_singleton_beans_by_their_type),
 like so?:
   ```
   camel.beans.mongoBean = #type:com.mongodb.client.MongoClient
   ```
   But how to add an instance of that type to the Camel context?  - there is 
the factory-like method `com.mongodb.client.MongoClients.create(String 
connectionString)` - I say "-like" because it doesn't return it's own type, but 
rather `com.mongodb.client.MongoClient` (singular), so placing this in 
properties doesn't work:
   ```
   camel.beans.mongoClient = 
#class:com.mongodb.client.MongoClients#create("...connection string...")
   ```
   - How can I combine the output of 
`#class:com.mongodb.client.MongoClients#create` with 
`#type:com.mongodb.client.MongoClient` ?
   ...or how could I utilise the [custom 
bean](https://github.com/apache/camel-kamelets/blob/790b6b93975a3d73fb6f8d2396c7aca72ef50766/mongodb-source.kamelet.yaml#L69)
 mentioned?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to