Skip to content

Commit

Permalink
Merge pull request #14032 from Nikolay Rybak
Browse files Browse the repository at this point in the history
* gh-14032:
  Propagate retryWrites flag from connection URI to ReactiveMongoClient
  • Loading branch information
wilkinsona committed Aug 13, 2018
2 parents 29e38f4 + 7759dcd commit 58aaf48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Expand Up @@ -159,6 +159,7 @@ private Builder createBuilder(MongoClientSettings settings,
if (connection.getApplicationName() != null) {
builder.applicationName(connection.getApplicationName());
}
builder.retryWrites(connection.getRetryWrites());
return builder;
}

Expand Down
Expand Up @@ -112,6 +112,14 @@ public void uriCanBeCustomized() {
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
public void uriCannotBeSetWithCredentials() {
MongoProperties properties = new MongoProperties();
Expand Down

0 comments on commit 58aaf48

Please sign in to comment.