org.springframework.data.mongodb.core.MongoClientFactoryBean
has been deprecated but we currently rely on it for auto-configuration.
Comment From: wilkinsona
As far as I can tell, our dependency is only for setting up dependsOn relationships between beans. Our auto-configuration creates a MongoClient
without using MongoClientFactoryBean
. I think we have a couple of options:
- Leave things as they are
- Ignore
MongoClientFactoryBean
in the dependsOn post-processors based on the assumption that it should no longer be used as it's deprecated.
I'm leaning towards 1 as, while deprecated, no replacement is offered so I think it's likely that it will continue to be used.
Comment From: philwebb
Sounds good. I'm wondering what we can use when MongoClientFactoryBean
is actually replaced?
Comment From: wilkinsona
I'm not sure. Hopefully @christophstrobl and @mp911de can offer some guidance when the time comes.
Comment From: snicoll
I am wondering if that one isn't actually superseded by #19356
Comment From: wilkinsona
Yeah, I think it is. The deprecation is such that I don't think we can migrate to non-deprecated API using the current version of the driver.
Comment From: DmitryN270713
Hi.
Can you tell me, when exactly it will deprecated? Currently I cannot see any signs of deprecation anywhere. I checked official documentation https://docs.spring.io/spring-data/data-mongodb/docs/current/api/org/springframework/data/mongodb/core/MongoClientFactoryBean.html nothing was mentioned about it. Moreover Visual Studio Code is quite about deprecation.
Also, after deprecation, what can I use with MongoTemplate instead of MongoClientFactoryBean?
Thank you in advance for the answer.
Comment From: wilkinsona
@DmitryN270713 It was deprecated in Spring Data 2.2 (https://docs.spring.io/spring-data/data-mongodb/docs/2.2.8.RELEASE/api/org/springframework/data/mongodb/core/MongoClientFactoryBean.html) when the factory bean produced a com.mongodb.MongoClient
. It was then replaced in 3.0 with a class of the same name that produces a com.mongodb.client.MongoClient
instead.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.