-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mongo Connector doesn't work with Spring Boot 2.4.1? #314
Comments
The most recent Spring Cloud Connectors release is The Spring Cloud Connectors was put into maintenance mode nearly 2 year ago, largely due to the fact that it was built before Spring Boot and it was very difficult to maintain compatibility with Boot as the two projects evolved. Changing Connectors to use a completely different MongoDB driver would not be a trivial change, and would require a new minor version release of Connectors (e.g. Java CFEnv was designed to work with Boot auto-configuration instead of competing with it. In many cases it is a drop-in replacement for Connectors, but that depends on how much of the Connectors API you are using. If you have specific questions or issues with migrating I'm happy to help however I can here. |
Thanks for the info and the offer. Could you suggest what I would do to replace this class with CFEnv? I tried to create my own extended AbstractCloudConfig and ServiceConnector so I could create MongoDatabaseFactory instead of MongoDbFactory, but the internals still direct to MongoDbFactory, so that didn't work. I think I would have to fork Cloud Connectors and change the registry.
|
I think maybe I do see what I can do with CFEnv from this JDBC example: String jdbcUrl1 = cfJdbcEnv.findJdbcServiceByName("mysqlA").getUrl(); Just get the conn properties for each service and build my own ConnectionString. I will try that. |
I don't think the CFEnvProcessor for Mongo would work in my case because I have potentially two different connections. |
Multiple connections of the same type (for example MongoDB) is a use case that neither Connectors or Spring Boot auto-configuration can handle without writing some code. This is a scenario where Java CFEnv isn't a drop-in replacement for Connectors, but hopefully it's not too much code to migrate. Let me know how its going and whether a sample of using Java CFEnv API in a scenario like this would be helpful. |
I am gradually getting my libraries converted. Once they're all converted I'll be able to try an app, since you can't mix CFEnv and Connectors. (I have some integration test apps that are working with CFEnv.) I am using core CFEnv instead of the Boot version because we have some special needs with multiple data sources, multiple Redis instances, etc. I must say that CFEnv is really much easier to understand and use than Connectors. I guess that's because it is such a thin layer over CF and doesn't have to worry about Cloud-portability |
@ddoubleday I'm going to close this issue, since there hasn't been any activity for a while. Feel free to reach out if you have any more questions or issues with your migration to Java CFEnv. |
I am trying to use spring-boot-starter-cloud-connectors 2.2.12 with SB 2.4.1. I'm a little confused about what is going on because the latest listed release here is 2.0.7, but 2.2.12 is available from somewhere.
Anyway, things have been going fine up until I ran into the problem that SB 2.4.1 requires spring-data-mongodb 3.1.2, which requires Mongo driver 4.x "sync" driver, not the "legacy" driver.
I am still able to create local mongodb connections and all my tests pass, but I can't can't connect to a cloud mongo because MongoDbFactoryCreator is trying to use MongoOptions, which is only in the legacy driver.
I have a huge installed base of services that depend on Cloud Connectors, and switching to the very different cf-env is going to be a blocker for upgrade if I can't resolve this issue.
Is there any hope?
The text was updated successfully, but these errors were encountered: