Skip to content

Added switcher-client scheduler logs - bump deps #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.9.5-eclipse-temurin-21-alpine AS maven
FROM maven:3.9.7-eclipse-temurin-21-alpine AS maven

WORKDIR /usr/src/app
COPY . /usr/src/app
Expand Down
17 changes: 9 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.3.0</version>
<relativePath>..</relativePath>
</parent>

Expand All @@ -63,23 +63,23 @@
<switcher-client.version>2.0.7</switcher-client.version>
<jsonwebtoken.version>0.12.5</jsonwebtoken.version>
<joda-time.version>2.12.7</joda-time.version>
<gson.version>2.10.1</gson.version>
<gson.version>2.11.0</gson.version>
<springdoc.version>2.5.0</springdoc.version>

<!-- Test-->
<flapdoodle.embed.mongo.version>4.12.2</flapdoodle.embed.mongo.version>
<flapdoodle.embed.mongo.version>4.14.0</flapdoodle.embed.mongo.version>

<!-- Managed -->
<snakeyaml.version>2.2</snakeyaml.version>
<tomcat-embed-core.version>10.1.23</tomcat-embed-core.version>
<tomcat-embed-core.version>10.1.24</tomcat-embed-core.version>
<logback-core.version>1.5.6</logback-core.version>
<jackson-core.version>2.17.0</jackson-core.version>
<jackson-core.version>2.17.1</jackson-core.version>
<json-path.version>2.9.0</json-path.version>
<json-smart.version>2.5.1</json-smart.version>
<commons-compress.version>1.26.1</commons-compress.version>
<commons-compress.version>1.26.2</commons-compress.version>

<!-- Plugins -->
<maven-compiler.version>3.12.1</maven-compiler.version>
<maven-compiler.version>3.13.0</maven-compiler.version>
<sonar.version>3.10.0.2594</sonar.version>
<jacoco.version>0.8.12</jacoco.version>

Expand All @@ -89,7 +89,8 @@
<sonar.language>java</sonar.language>
<sonar.coverage.exclusions>
**/model/**/*.java,
**/config/SwitcherFeatures.java
**/config/SwitcherFeatures.java,
**/config/SwitcherConfig.java,
</sonar.coverage.exclusions>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

import com.github.switcherapi.ac.util.FileUtil;
import com.github.switcherapi.client.ContextBuilder;
import com.github.switcherapi.client.SnapshotCallback;
import jakarta.annotation.PostConstruct;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import static com.github.switcherapi.ac.config.SwitcherFeatures.configure;
import static com.github.switcherapi.ac.config.SwitcherFeatures.initializeClient;
import static com.github.switcherapi.client.SwitcherContextBase.scheduleSnapshotAutoUpdate;

@Slf4j
@Configuration
@ConfigurationProperties(prefix = "switcher")
@Data
Expand Down Expand Up @@ -51,13 +55,19 @@ private void configureSwitcher() {
.component(component)
.local(local)
.silentMode(silent)
.snapshotAutoUpdateInterval(snapshot.getAutoUpdateInterval())
.snapshotLocation(StringUtils.isNotBlank(snapshot.getLocation()) ? snapshot.getLocation() : null)
.snapshotAutoLoad(snapshot.isAuto())
.truststorePath(StringUtils.isNotBlank(truststore.getPath()) ? FileUtil.getFilePathFromResource(truststore.getPath()) : null)
.truststorePassword(StringUtils.isNotBlank(truststore.getPassword()) ? truststore.getPassword() : null)
);

scheduleSnapshotAutoUpdate(snapshot.getAutoUpdateInterval(), new SnapshotCallback() {
@Override
public void onSnapshotUpdate(long version) {
log.info("Snapshot updated: {}", version);
}
});

initializeClient();
}

Expand Down