Skip to content

Commit

Permalink
FMWK-357 Fix setting hosts in configuration (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr authored Mar 19, 2024
1 parent 638b353 commit 594d4fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,18 @@ protected AerospikeSettings aerospikeSettings(AerospikeDataSettings dataSettings
// values set via configureDataSettings() have precedence over the parameters from application.properties
configureDataSettings(dataSettings);

// getHosts() return value has precedence over hosts parameter from application.properties
// getHosts() has precedence over hosts parameter from application.properties
Collection<Host> hosts;
if ((hosts = getHosts()) != null) {
connectionSettings.setHostsArray(hosts.toArray(new Host[0]));
} else if (!StringUtils.hasText(connectionSettings.getHosts())) {
} else if (StringUtils.hasText(connectionSettings.getHosts())) {
connectionSettings.setHostsArray(Host.parseHosts(connectionSettings.getHosts(), getDefaultPort()));
} else {
throw new IllegalStateException("No hosts found, please set hosts parameter in application.properties or " +
"override getHosts() method");
}
connectionSettings.setHostsArray(Host.parseHosts(connectionSettings.getHosts(), getDefaultPort()));

// nameSpace() return value has precedence over namespace parameter from application.properties
// nameSpace() has precedence over namespace parameter from application.properties
String namespace;
if ((namespace = nameSpace()) != null) connectionSettings.setNamespace(namespace);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface AerospikeConverter extends AerospikeReader<Object>, AerospikeWr
/**
* Key that identifies POJO's class.
*/
public static final String CLASS_KEY = "@_class";
String CLASS_KEY = "@_class";

/**
* Access Aerospike-specific conversion service.
Expand Down

0 comments on commit 594d4fb

Please sign in to comment.