Skip to content

Commit

Permalink
Merge pull request #81 from scalecube/update/dependencies
Browse files Browse the repository at this point in the history
Update/dependencies
  • Loading branch information
artem-v authored Feb 19, 2020
2 parents 5008184 + 621e624 commit f18ca86
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

<mainClass>io.scalecube.seed.SeedRunner</mainClass>

<scalecube-services.version>2.8.10-RC2</scalecube-services.version>
<scalecube-config.version>0.3.14</scalecube-config.version>
<scalecube-services.version>2.8.10-RC3</scalecube-services.version>
<scalecube-config.version>0.4.0-RC4</scalecube-config.version>
<jackson.version>2.10.0.pr1</jackson.version>
<log4j.version>2.11.1</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.30</slf4j.version>
<netty.version>4.1.37.Final</netty.version>
<reactor.version>Dysprosium-RELEASE</reactor.version>
<reactor-netty.version>0.9.0.RELEASE</reactor-netty.version>
Expand Down
32 changes: 14 additions & 18 deletions src/main/java/io/scalecube/seed/SeedRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
import io.scalecube.services.ServiceEndpoint;
import io.scalecube.services.discovery.ScalecubeServiceDiscovery;
import io.scalecube.services.discovery.api.ServiceDiscovery;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.StringJoiner;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -43,7 +41,7 @@ public static void main(String[] args) {
configRegistry
.objectProperty(Config.class.getPackage().getName(), Config.class)
.value()
.orElseThrow(() -> new IllegalStateException("Couldn't load config"));
.orElseThrow(() -> new IllegalStateException("Couldn't load config: " + Config.class));

LOGGER.info(DECORATOR);
LOGGER.info("Starting Seed, {}", config);
Expand Down Expand Up @@ -75,19 +73,19 @@ private static void newLogo(Microservices microservices) {

public static class Config {

Integer discoveryPort;
List<String> seeds;
String memberAlias;
private int discoveryPort = 4801;
private List<String> seeds = Collections.emptyList();
private String memberAlias = "seed";

public Integer discoveryPort() {
public int discoveryPort() {
return discoveryPort;
}

public String memberAlias() {
return memberAlias;
}

List<Address> seedAddresses() {
public List<Address> seedAddresses() {
return seeds.stream().map(Address::from).collect(Collectors.toList());
}

Expand All @@ -103,19 +101,17 @@ public String toString() {

static class ConfigBootstrap {

private static final Pattern CONFIG_FILE_PATTERN =
Pattern.compile("(.*)config(.*)?\\.properties");
private static final Predicate<Path> CONFIG_PATH_PREDICATE =
path -> CONFIG_FILE_PATTERN.matcher(path.getFileName().toString()).matches();

static ConfigRegistry configRegistry() {
return ConfigRegistry.create(
ConfigRegistrySettings.builder()
.addListener(new Slf4JConfigEventListener())
.addLastSource("sys_prop", new SystemPropertiesConfigSource())
.addLastSource("env_var", new SystemEnvironmentConfigSource())
.addLastSource("cp", new ClassPathConfigSource(CONFIG_PATH_PREDICATE))
.jmxEnabled(false)
.addListener(new Slf4JConfigEventListener())
.addLastSource("environment", new SystemEnvironmentConfigSource())
.addLastSource("system", new SystemPropertiesConfigSource())
.addLastSource(
"classpath",
ClassPathConfigSource.createWithPattern(
"config.properties", Collections.emptyList()))
.build());
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/main/resources/config-seed.properties

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/resources/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
io.scalecube.seed.discoveryPort=4801
io.scalecube.seed.memberAlias=seed
3 changes: 3 additions & 0 deletions src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<Logger name="reactor.core" level="${env:reactorCoreLogLevel:-WARN}"/>
<Logger name="reactor.netty" level="${env:reactorNettyLogLevel:-WARN}"/>
<Logger name="io.netty" level="${env:nettyLogLevel:-WARN}"/>
<logger name="io.rsocket.transport.netty" level="${env:rsocketTransportNettyLogLevel:-WARN}"/>
<logger name="io.rsocket.FrameLogger" level="${env:rsocketFrameLoggerLogLevel:-WARN}"/>
<logger name="io.rsocket" level="${env:rsocketLogLevel:-INFO}"/>

<Root level="${env:logLevel:-DEBUG}">
<AppenderRef ref="${env:logAppender:-STDOUT}"/>
Expand Down

0 comments on commit f18ca86

Please sign in to comment.