Skip to content

Commit

Permalink
CLeanup
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed Sep 30, 2022
1 parent a404fce commit f5cfbdd
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 1,406 deletions.
29 changes: 4 additions & 25 deletions config-examples/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>io.scalecube</groupId>
Expand All @@ -10,35 +12,12 @@

<artifactId>scalecube-config-examples</artifactId>

<properties>
<log4j.version>2.17.1</log4j.version>
</properties>

<dependencies>
<dependency>
<groupId>io.scalecube</groupId>
<artifactId>scalecube-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.scalecube</groupId>
<artifactId>scalecube-config-mongo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.scalecube</groupId>
<artifactId>scalecube-config-http-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.scalecube.config.ConfigRegistrySettings;
import io.scalecube.config.StringConfigProperty;
import io.scalecube.config.audit.Slf4JConfigEventListener;
import io.scalecube.config.http.server.ConfigRegistryHttpServer;
import io.scalecube.config.source.ClassPathConfigSource;
import io.scalecube.config.source.FileDirectoryConfigSource;
import java.nio.file.Path;
Expand Down Expand Up @@ -37,8 +36,5 @@ public static void main(String[] args) {
StringConfigProperty orderedProp1 = configRegistry.stringProperty("orderedProp1");

System.out.println("### Matched by first predicate orderedProp1=" + orderedProp1.value().get());

// Start REST HTTP Server
ConfigRegistryHttpServer.create(configRegistry, 5050);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
import io.scalecube.config.ConfigRegistrySettings;
import io.scalecube.config.StringConfigProperty;
import io.scalecube.config.audit.Slf4JConfigEventListener;
import io.scalecube.config.http.server.ConfigRegistryHttpServer;
import io.scalecube.config.keyvalue.KeyValueConfigSource;
import io.scalecube.config.mongo.MongoConfigConnector;
import io.scalecube.config.mongo.MongoConfigEventListener;
import io.scalecube.config.mongo.MongoConfigRepository;
import io.scalecube.config.source.FileDirectoryConfigSource;
import java.nio.file.Path;
import java.util.function.Predicate;
Expand All @@ -28,14 +23,6 @@ public static void main(String[] args) {
String configSourceCollectionName = "MongoConfigRepository";
String auditLogCollectionName = "TestConfigurationAuditLog";

MongoConfigConnector connector = MongoConfigConnector.builder().forUri(uri).build();

KeyValueConfigSource mongoConfigSource =
KeyValueConfigSource.withRepository(
new MongoConfigRepository(connector), configSourceCollectionName)
.groups("group2", "group1", "root")
.build();

// Local resource cfg source init
Predicate<Path> propsPredicate = path -> path.toString().endsWith(".props");
String basePath = "config-examples/config";
Expand All @@ -46,9 +33,7 @@ public static void main(String[] args) {
ConfigRegistrySettings.builder()
.addLastSource(
"ConfigDirectory", new FileDirectoryConfigSource(basePath, propsPredicate))
.addLastSource("MongoConfig", mongoConfigSource)
.addListener(new Slf4JConfigEventListener())
.addListener(new MongoConfigEventListener(connector, auditLogCollectionName))
.keepRecentConfigEvents(10)
.reloadIntervalSec(3)
.jmxEnabled(true)
Expand All @@ -57,9 +42,6 @@ public static void main(String[] args) {

// Inject cfgReg into target component
SomeComponent component = new SomeComponent(configRegistry);

// Start REST HTTP Server
ConfigRegistryHttpServer.create(configRegistry, 5050);
}

static class SomeComponent {
Expand Down

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions config-http-server/pom.xml

This file was deleted.

This file was deleted.

Loading

0 comments on commit f5cfbdd

Please sign in to comment.