Skip to content

Commit

Permalink
Merge pull request #5797 from gsmet/fix-minor-config-stuff
Browse files Browse the repository at this point in the history
Fix a few minor low hanging fruits of the config PR
  • Loading branch information
machi1990 authored Nov 27, 2019
2 parents a4a4ef2 + 3efe461 commit 24846a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static class ElasticsearchBackendRuntimeConfig {
* The list of hosts of the Elasticsearch servers.
*/
@ConfigItem(defaultValue = "http://localhost:9200")
Optional<List<String>> hosts;
List<String> hosts;

/**
* The username used for authentication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public class MongoClientConfig {
public Optional<String> connectionString;

/**
* Configures the Mongo server addressed (one if single mode).
* The addressed are passed as {@code host:port}.
* Configures the MongoDB server addressed (one if single mode).
* The addresses are passed as {@code host:port}.
*/
@ConfigItem
public Optional<List<String>> hosts;
@ConfigItem(defaultValue = "127.0.0.1:27017")
public List<String> hosts;

/**
* Configure the database name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void initialize(MongoClientConfig config, List<String> codecProviders) {
settings.applyToClusterSettings(builder -> {
if (!maybeConnectionString.isPresent()) {
// Parse hosts
List<ServerAddress> hosts = parseHosts(config.hosts.orElse(Collections.emptyList()));
List<ServerAddress> hosts = parseHosts(config.hosts);
builder.hosts(hosts);

if (hosts.size() == 1 && !config.replicaSetName.isPresent()) {
Expand Down

0 comments on commit 24846a9

Please sign in to comment.