-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix
Description
Hi,
I tried to migrate from Spring Boot 2.3.7.RELEASE
to 2.4.1
:
@Bean
public MongoClientSettings mongoOptions() {
return MongoClientSettings.builder()
.applyToSocketSettings(
builder -> builder.connectTimeout(30, TimeUnit.SECONDS))
.build();
}
When I remove MongoClientSettings
it works, but if I enable it, I got spring.data.mongodb.uri
ignored:
2021-01-04 22:33:30.843+0100 [main] [org.mongodb.driver.cluster] INFO [SLF4JLogger.info:71] - Cluster created with settings {hosts=[127.0.0.1:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms'}
I tried a workaround by adding connectTimeout=10000
in URI property and I got:
2021-01-04 22:43:07.244+0100 [main] [org.mongodb.driver.cluster] INFO [SLF4JLogger.info:71] - Cluster created with settings {hosts=[xx.xxx.xxx.xxx:27017, xx.xxx.xxx.xxx:27017, xx.xxx.xxx.xxx:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', requiredReplicaSetName='rs-dev'}
Thanks
Metadata
Metadata
Assignees
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix