Propagate retryWrites flag from connection URI to ReactiveMongoClient
Closes gh-14032
This commit is contained in:
committed by
Andy Wilkinson
parent
718372edb2
commit
7759dcd9df
@@ -159,6 +159,7 @@ public class ReactiveMongoClientFactory {
|
|||||||
if (connection.getApplicationName() != null) {
|
if (connection.getApplicationName() != null) {
|
||||||
builder.applicationName(connection.getApplicationName());
|
builder.applicationName(connection.getApplicationName());
|
||||||
}
|
}
|
||||||
|
builder.retryWrites(connection.getRetryWrites());
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ public class ReactiveMongoClientFactoryTests {
|
|||||||
assertMongoCredential(credential, "user", "secret", "test");
|
assertMongoCredential(credential, "user", "secret", "test");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void retryWritesIsPropagatedFromUri() {
|
||||||
|
MongoProperties properties = new MongoProperties();
|
||||||
|
properties.setUri("mongodb://localhost/test?retryWrites=true");
|
||||||
|
MongoClient client = createMongoClient(properties);
|
||||||
|
assertThat(client.getSettings().getRetryWrites()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void uriCannotBeSetWithCredentials() {
|
public void uriCannotBeSetWithCredentials() {
|
||||||
MongoProperties properties = new MongoProperties();
|
MongoProperties properties = new MongoProperties();
|
||||||
|
|||||||
Reference in New Issue
Block a user