davsclaus commented on issue #2444:
URL: https://github.com/apache/camel-k/issues/2444#issuecomment-868287360
Camel 3.12 now supports the factory method (must be public static). You can
include the return type class of the created bean (if you want) as that allows
Camel to know its type for dependency injection, otherwise it becomes a Object
type. You do this with the `bean-type` as shown:
```
flow:
beans:
- name: mongoDBConnection
type:
'#class:com.mongodb.client.MongoClients#create("mongodb://myuser:[email protected]:27017")'
bean-type 'com.mongodb.client.MongoClient`
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]