Repository: Unleash/unleash-client-java
Pull request #281 (2025-02-11 10:42:02)

fix: fetch interval should match default
## About the changes

* fetch flag calls include `unleash-interval` header
* send metrics calls include `unleash-interval` header
* `unleash-interval` header is included even when it's set to 0 (but when it's is 0 then no API calls should be made)
* registration calls has `connectionId` added to payload (previously it had `unleash-connection-id` header only)
* send metrics has `connectionId` added to payload (previously it had `unleash-connection-id` header only)


Patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bc82f8d0..d3d1f597 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -30,16 +30,6 @@ jobs:
           base-path: src/main/java
           parallel: true
           flag-name: run-jvm-${{ join(matrix.*, '-') }}
-      - name: Notify Slack of pipeline completion
-        uses: 8398a7/action-slack@v2
-        with:
-          status: ${{ job.status }}
-          author_name: Github Action
-          text: Build on Java ${{ matrix.version }}
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook }}
-        if: always()
   finish:
     needs: build
     if: ${{ always() }}
diff --git a/.github/workflows/publish_javadoc.yml b/.github/workflows/publish_javadoc.yml
index c99f4aac..1d6b3084 100644
--- a/.github/workflows/publish_javadoc.yml
+++ b/.github/workflows/publish_javadoc.yml
@@ -8,7 +8,7 @@ on:
 
 jobs:
   javadoc:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-latest
     steps:
       - name: Checkout
         uses: actions/checkout@v4
diff --git a/README.md b/README.md
index d84e927d..bcae8eed 100644
--- a/README.md
+++ b/README.md
@@ -464,7 +464,7 @@ The `UnleashConfig$Builder` class (created via `UnleashConfig.builder()`) expose
 | `enableProxyAuthenticationByJvmProperties` | Enable support for [using JVM properties for HTTP proxy authentication](#http-proxy-with-authentication).                                                                                                                                        | No       | `false`                                                                                                              |
 | `environment`                              | The value to set for the Unleash context's `environment` property. **Not** the same as [Unleash's environments](https://docs.getunleash.io/reference/environments).| No       | `null`                                                                                                               |
 | `fallbackStrategy`                         | A strategy implementation that the client can use if it doesn't recognize the strategy type returned from the server.                                                                                                                            | No       | `null`                                                                                                               |
-| `fetchTogglesInterval`                     | How often (in seconds) the client should check for toggle updates. Set to `0` if you want to only check once.                                                                                                                                    | No       | `10`                                                                                                                 |
+| `fetchTogglesInterval`                     | How often (in seconds) the client should check for toggle updates. Set to `0` if you want to only check once.                                                                                                                                    | No       | `15`                                                                                                                 |
 | `instanceId`                               | A unique(-ish) identifier for your instance. Typically a hostname, pod id or something similar. Unleash uses this to separate metrics from the client SDKs with the same `appName`.                                                              | Yes      | `null`                                                                                                               |
 | `namePrefix`                               | If provided, the client will only fetch toggles whose name starts with the provided value.                                                                                                                                                       | No       | `null`                                                                                                               |
 | `projectName`                              | If provided, the client will only fetch toggles from the specified project. (This can also be achieved with an API token).                                                                                                                       | No       | `null`                                                                                                               |
diff --git a/pom.xml b/pom.xml
index e07d07f1..d1c1846f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>io.getunleash</groupId>
     <artifactId>unleash-client-java</artifactId>
-    <version>10.1.0</version>
+    <version>10.0.3</version>
 
     <properties>
         <version.slf4j>2.0.13</version.slf4j>
@@ -59,7 +59,7 @@
         <dependency>
             <groupId>io.getunleash</groupId>
             <artifactId>yggdrasil-engine</artifactId>
-            <version>0.1.0-alpha.17</version>
+            <version>0.1.0</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
diff --git a/pom.xml.versionsBackup b/pom.xml.versionsBackup
new file mode 100644
index 00000000..73e47892
--- /dev/null
+++ b/pom.xml.versionsBackup
@@ -0,0 +1,559 @@
+<?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">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>io.getunleash</groupId>
+    <artifactId>unleash-client-java</artifactId>
+    <version>10.1.0</version>
+
+    <properties>
+        <version.slf4j>2.0.13</version.slf4j>
+        <version.junit5>5.10.3</version.junit5>
+        <version.okhttp>4.12.0</version.okhttp>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <version.unleash.specification>5.1.9</version.unleash.specification>
+        <arguments />
+        <version.jackson>2.17.2</version.jackson>
+        <version.logback>1.3.14</version.logback>
+        <version.gson>2.11.0</version.gson>
+    </properties>
+
+    <name>io.getunleash:unleash-client-java</name>
+    <description>A client library for Unleash</description>
+    <url>https://github.com/Unleash/unleash-client-java</url>
+    <inceptionYear>2014</inceptionYear>
+
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+    <developers>
+        <developer>
+            <id>chriswk</id>
+            <email>chriswk@getunleash.io</email>
+            <name>Christopher Kolstad</name>
+            <url>https://github.com/chriswk</url>
+            <organization>Unleash</organization>
+            <organizationUrl>https://getunleash.io</organizationUrl>
+        </developer>
+        <developer>
+            <id>ivarconr</id>
+            <email>ivar@getunleash.io</email>
+            <name>Ivar Conradi Østhus</name>
+            <url>https://github.com/ivarconr</url>
+            <organizationUrl>https://getunleash.io</organizationUrl>
+            <organization>Unleash</organization>
+        </developer>
+    </developers>
+
+    <scm>
+        <url>https://github.com/Unleash/unleash-client-java</url>
+        <connection>scm:git:https://github.com/Unleash/unleash-client-java.git</connection>
+        <developerConnection>scm:git:https://github.com/Unleash/unleash-client-java.git</developerConnection>
+      <tag>unleash-client-java-10.0.0-beta.1</tag>
+  </scm>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.getunleash</groupId>
+            <artifactId>yggdrasil-engine</artifactId>
+            <version>0.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${version.gson}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>${version.okhttp}</version>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${version.slf4j}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <version>3.0.2</version>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sangupta</groupId>
+            <artifactId>murmur</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+        <!-- Test dependencies -->
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <version>${version.junit5}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-params</artifactId>
+            <version>${version.junit5}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- Legacy support -->
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <version>3.26.3</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>4.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.tomakehurst</groupId>
+            <artifactId>wiremock-jre8</artifactId>
+            <version>2.35.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>${version.jackson}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+            <version>${version.jackson}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${version.jackson}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>${version.logback}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>${version.logback}</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>3.8.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <version>3.12.0</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.13.0</version>
+                <configuration>
+                    <release>8</release>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>3.5.2</version>
+                <configuration>
+                    <forkCount>1</forkCount>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>3.4.2</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+
+
+            <!--Code analysis tools-->
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.8.12</version>
+                <executions>
+                    <execution>
+                        <id>prepare-agent</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!--Download client-specifications-->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>wagon-maven-plugin</artifactId>
+                <version>2.0.2</version>
+                <executions>
+                    <execution>
+                        <id>download-client-specifications</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>download-single</goal>
+                        </goals>
+                        <configuration>
+                            <url>https://github.com</url>
+                            <fromFile>Unleash/client-specification/archive/v${version.unleash.specification}.zip
+                            </fromFile>
+                            <toDir>${project.build.directory}/client-specification</toDir>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!--Unpack client-specification-->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>truezip-maven-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>unpack-client-specification</id>
+                        <goals>
+                            <goal>copy</goal>
+                        </goals>
+                        <phase>process-test-resources</phase>
+                        <configuration>
+                            <verbose>true</verbose>
+                            <fileset>
+                                <directory>
+                                    ${project.build.directory}/client-specification/v${version.unleash.specification}.zip
+                                </directory>
+                                <outputDirectory>${project.build.directory}/client-specification/</outputDirectory>
+                            </fileset>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!--Move & rename client-specification-->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>3.3.1</version>
+                <executions>
+                    <execution>
+                        <id>move-client-specification</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.testOutputDirectory}/client-specification</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>
+                                        ${project.build.directory}/client-specification/client-specification-${version.unleash.specification}
+                                    </directory>
+                                    <filtering>false</filtering>
+                                </resource>
+                            </resources>
+                            <encoding>UTF-8</encoding>
+                        </configuration>
+                    </execution>
+                </executions>
+                <configuration>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+                <version>3.1.1</version>
+                <configuration>
+                    <mavenExecutorId>forked-path</mavenExecutorId>
+                    <useReleaseProfile>false</useReleaseProfile>
+                    <arguments>${arguments} -Psonatype-release</arguments>
+                </configuration>
+            </plugin>
+            <!-- JReleaser -->
+            <plugin>
+              <groupId>org.jreleaser</groupId>
+              <artifactId>jreleaser-maven-plugin</artifactId>
+              <version>1.16.0</version>
+              <inherited>false</inherited>
+              <configuration>
+                <jreleaser>
+                  <signing>
+                    <active>ALWAYS</active>
+                    <armored>true</armored>
+                 </signing>
+                 <deploy>
+                   <maven>
+                     <mavenCentral>
+                       <sonatype>
+                         <active>ALWAYS</active>
+                         <url>https://central.sonatype.com/api/v1/publisher</url>
+                         <stagingRepositories>target/staging-deploy</stagingRepositories>
+                      </sonatype>
+                      </mavenCentral>
+                    </maven>
+                 </deploy>
+                </jreleaser>
+              </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.diffplug.spotless</groupId>
+                <artifactId>spotless-maven-plugin</artifactId>
+                <version>2.30.0</version>
+                <configuration>
+                    <formats>
+                        <format>
+                            <includes>
+                                <include>*.md</include>
+                                <include>.gitignore</include>
+                            </includes>
+                            <trimTrailingWhitespace />
+                            <endWithNewline />
+                            <indent>
+                                <spaces>true</spaces>
+                                <tabs>false</tabs>
+                                <spacesPerTab>4</spacesPerTab>
+                            </indent>
+                        </format>
+                    </formats>
+                    <java>
+                        <removeUnusedImports />
+                        <toggleOffOn />
+                        <googleJavaFormat>
+                            <style>AOSP</style>
+                        </googleJavaFormat>
+                        <indent>
+                            <spaces>true</spaces>
+                        </indent>
+                    </java>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>check</id>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>format</id>
+                        <goals>
+                            <goal>apply</goal>
+                        </goals>
+                        <phase>compile</phase>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-project-info-reports-plugin</artifactId>
+                <version>3.8.0</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.11.2</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>3.5.2</version>
+            </plugin>
+        </plugins>
+    </reporting>
+    <profiles>
+        <profile>
+            <id>sonatype-release</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <properties>
+                <sonatypeOssDistMgmtSnapshotsUrl>https://s01.oss.sonatype.org/content/repositories/snapshots</sonatypeOssDistMgmtSnapshotsUrl>
+            </properties>
+            <repositories>
+                <repository>
+                    <id>sonatype-nexus-snapshots</id>
+                    <name>Sonatype Nexus Snapshots</name>
+                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+                    <releases>
+                        <enabled>false</enabled>
+                    </releases>
+                    <snapshots>
+                        <enabled>true</enabled>
+                    </snapshots>
+                </repository>
+            </repositories>
+            <distributionManagement>
+                <snapshotRepository>
+                    <id>sonatype-nexus-snapshots</id>
+                    <name>Sonatype Nexus Snapshots</name>
+                    <url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
+                </snapshotRepository>
+                <repository>
+                    <id>sonatype-nexus-staging</id>
+                    <name>Nexus Release Repository</name>
+                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+                </repository>
+            </distributionManagement>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <version>3.3.1</version>
+                        <executions>
+                            <execution>
+                                <id>attach-sources</id>
+                                <goals>
+                                    <goal>jar-no-fork</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <version>3.11.2</version>
+                        <executions>
+                            <execution>
+                                <id>attach-javadocs</id>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-gpg-plugin</artifactId>
+                        <version>3.1.0</version>
+                        <executions>
+                            <execution>
+                                <id>sign-artifacts</id>
+                                <phase>verify</phase>
+                                <goals>
+                                    <goal>sign</goal>
+                                </goals>
+                            </execution>
+                          </executions>
+                          <configuration>
+                            <gpgArguments>
+                              <arg>--pinentry-mode</arg>
+                              <arg>loopback</arg>
+                            </gpgArguments>
+                          </configuration>
+                    </plugin>
+                                <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>nexus-staging-maven-plugin</artifactId>
+                <version>1.7.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <serverId>ossrh</serverId>
+                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
+                </configuration>
+            </plugin>
+                </plugins>
+
+            </build>
+        </profile>
+        <profile>
+            <id>publication</id>
+            <properties>
+                <altDeploymentRepository>local::file:./target/staging-deploy</altDeploymentRepository>
+            </properties>
+            <build>
+                <defaultGoal>deploy</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-javadocs</id>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                                <configuration>
+                                    <attach>true</attach>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-sources</id>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                                <configuration>
+                                    <attach>true</attach>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+                        <distributionManagement>
+                <snapshotRepository>
+                    <id>sonatype-nexus-snapshots</id>
+                    <name>Sonatype Nexus Snapshots</name>
+                    <url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
+                </snapshotRepository>
+                <repository>
+                    <id>sonatype-nexus-staging</id>
+                    <name>Nexus Release Repository</name>
+                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+                </repository>
+            </distributionManagement>
+        </profile>
+    </profiles>
+</project>
diff --git a/src/main/java/io/getunleash/metric/ClientMetrics.java b/src/main/java/io/getunleash/metric/ClientMetrics.java
index 8b6bfdf8..cbc371f5 100644
--- a/src/main/java/io/getunleash/metric/ClientMetrics.java
+++ b/src/main/java/io/getunleash/metric/ClientMetrics.java
@@ -11,6 +11,7 @@ public class ClientMetrics implements UnleashEvent {
 
     private final String appName;
     private final String instanceId;
+    private final String connectionId;
     private final MetricsBucket bucket;
     private final String environment;
     private final String specVersion;
@@ -22,6 +23,7 @@ public class ClientMetrics implements UnleashEvent {
         this.environment = config.getEnvironment();
         this.appName = config.getAppName();
         this.instanceId = config.getInstanceId();
+        this.connectionId = config.getConnectionId();
         this.bucket = bucket;
         this.specVersion = config.getClientSpecificationVersion();
         this.platformName = System.getProperty("java.vm.name");
@@ -37,6 +39,10 @@ public class ClientMetrics implements UnleashEvent {
         return instanceId;
     }
 
+    public String getConnectionId() {
+        return connectionId;
+    }
+
     public MetricsBucket getBucket() {
         return bucket;
     }
@@ -71,6 +77,12 @@ public class ClientMetrics implements UnleashEvent {
 
     @Override
     public String toString() {
-        return "metrics:" + " appName=" + appName + " instanceId=" + instanceId;
+        return "metrics:"
+                + " appName="
+                + appName
+                + " instanceId="
+                + instanceId
+                + " connectionId="
+                + connectionId;
     }
 }
diff --git a/src/main/java/io/getunleash/metric/ClientRegistration.java b/src/main/java/io/getunleash/metric/ClientRegistration.java
index 8af6f078..accddd5a 100644
--- a/src/main/java/io/getunleash/metric/ClientRegistration.java
+++ b/src/main/java/io/getunleash/metric/ClientRegistration.java
@@ -11,6 +11,7 @@ import java.util.Set;
 public class ClientRegistration implements UnleashEvent {
     private final String appName;
     private final String instanceId;
+    private final String connectionId;
     private final String sdkVersion;
     private final Set<String> strategies;
     private final LocalDateTime started;
@@ -26,6 +27,7 @@ public class ClientRegistration implements UnleashEvent {
         this.appName = config.getAppName();
         this.instanceId = config.getInstanceId();
         this.sdkVersion = config.getSdkVersion();
+        this.connectionId = config.getConnectionId();
         this.started = started;
         this.strategies = strategies;
         this.interval = config.getSendMetricsInterval();
@@ -43,6 +45,10 @@ public class ClientRegistration implements UnleashEvent {
         return instanceId;
     }
 
+    public String getConnectionId() {
+        return connectionId;
+    }
+
     public String getSdkVersion() {
         return sdkVersion;
     }
diff --git a/src/main/java/io/getunleash/metric/UnleashMetricServiceImpl.java b/src/main/java/io/getunleash/metric/UnleashMetricServiceImpl.java
index 97054aea..b50a9f52 100644
--- a/src/main/java/io/getunleash/metric/UnleashMetricServiceImpl.java
+++ b/src/main/java/io/getunleash/metric/UnleashMetricServiceImpl.java
@@ -93,11 +93,19 @@ public class UnleashMetricServiceImpl implements UnleashMetricService {
 
     @Override
     public void countToggle(String name, boolean enabled) {
-        this.engine.countToggle(name, enabled);
+        try {
+            this.engine.countToggle(name, enabled);
+        } catch (YggdrasilError e) {
+            LOGGER.error("Failed to count toggle", e);
+        }
     }
 
     @Override
     public void countVariant(String name, String variantName) {
-        this.engine.countVariant(name, variantName);
+        try {
+            this.engine.countVariant(name, variantName);
+        } catch (YggdrasilError e) {
+            LOGGER.error("Failed to count variant", e);
+        }
     }
 }
diff --git a/src/main/java/io/getunleash/util/OkHttpClientConfigurer.java b/src/main/java/io/getunleash/util/OkHttpClientConfigurer.java
index 019cf9f9..d4e9be17 100644
--- a/src/main/java/io/getunleash/util/OkHttpClientConfigurer.java
+++ b/src/main/java/io/getunleash/util/OkHttpClientConfigurer.java
@@ -20,6 +20,9 @@ public class OkHttpClientConfigurer {
                                             .addHeader(
                                                     UNLEASH_INSTANCE_ID_HEADER,
                                                     config.getInstanceId())
+                                            .addHeader(
+                                                    UNLEASH_INTERVAL,
+                                                    config.getFetchTogglesIntervalMillis())
                                             .addHeader(
                                                     UNLEASH_CONNECTION_ID_HEADER,
                                                     config.getConnectionId())
diff --git a/src/main/java/io/getunleash/util/UnleashConfig.java b/src/main/java/io/getunleash/util/UnleashConfig.java
index 83e4d162..f1f2bc57 100644
--- a/src/main/java/io/getunleash/util/UnleashConfig.java
+++ b/src/main/java/io/getunleash/util/UnleashConfig.java
@@ -28,6 +28,7 @@ public class UnleashConfig {
 
     public static final String UNLEASH_INSTANCE_ID_HEADER = "UNLEASH-INSTANCEID";
     public static final String UNLEASH_CONNECTION_ID_HEADER = "UNLEASH-CONNECTION-ID";
+    public static final String UNLEASH_INTERVAL = "UNLEASH-INTERVAL";
     public static final String UNLEASH_APP_NAME_HEADER = "UNLEASH-APPNAME";
     public static final String UNLEASH_SDK_HEADER = "UNLEASH-SDK";
 
@@ -184,6 +185,7 @@ public class UnleashConfig {
         config.customHttpHeadersProvider.getCustomHeaders().forEach(connection::setRequestProperty);
         // prevent overwrite
         connection.setRequestProperty(UNLEASH_CONNECTION_ID_HEADER, config.getConnectionId());
+        connection.setRequestProperty(UNLEASH_INTERVAL, config.getFetchTogglesIntervalMillis());
     }
 
     private void enableProxyAuthentication() {
@@ -216,7 +218,7 @@ public class UnleashConfig {
         return instanceId;
     }
 
-    String getConnectionId() {
+    public String getConnectionId() {
         return connectionId;
     }
 
@@ -236,6 +238,10 @@ public class UnleashConfig {
         return fetchTogglesInterval;
     }
 
+    public String getFetchTogglesIntervalMillis() {
+        return String.valueOf(fetchTogglesInterval * 1000);
+    }
+
     public Duration getFetchTogglesConnectTimeout() {
         return fetchTogglesConnectTimeout;
     }
@@ -416,7 +422,7 @@ public class UnleashConfig {
         private @Nullable String backupFile;
         private @Nullable String projectName;
         private @Nullable String namePrefix;
-        private long fetchTogglesInterval = 10;
+        private long fetchTogglesInterval = 15;
 
         private Duration fetchTogglesConnectTimeout = Duration.ofSeconds(10);
 


Test patch:
diff --git a/src/test/java/io/getunleash/metric/DefaultHttpMetricsSenderTest.java b/src/test/java/io/getunleash/metric/DefaultHttpMetricsSenderTest.java
index 7f8be65e..b1dcf9a6 100644
--- a/src/test/java/io/getunleash/metric/DefaultHttpMetricsSenderTest.java
+++ b/src/test/java/io/getunleash/metric/DefaultHttpMetricsSenderTest.java
@@ -9,6 +9,8 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
 import static com.github.tomakehurst.wiremock.client.WireMock.verify;
 import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static io.getunleash.util.UnleashConfig.UNLEASH_CONNECTION_ID_HEADER;
+import static io.getunleash.util.UnleashConfig.UNLEASH_INTERVAL;
 
 import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
 import io.getunleash.engine.MetricsBucket;
@@ -41,13 +43,14 @@ public class DefaultHttpMetricsSenderTest {
         UnleashConfig config = UnleashConfig.builder().appName("test-app").unleashAPI(uri).build();
 
         DefaultHttpMetricsSender sender = new DefaultHttpMetricsSender(config);
-        sender.registerClient(
-                new ClientRegistration(config, LocalDateTime.now(), new HashSet<String>()));
+        sender.registerClient(new ClientRegistration(config, LocalDateTime.now(), new HashSet<>()));
 
         verify(
                 postRequestedFor(urlMatching("/client/register"))
                         .withRequestBody(matching(".*appName.*"))
                         .withRequestBody(matching(".*strategies.*"))
+                        .withHeader(
+                                UNLEASH_CONNECTION_ID_HEADER, matching(config.getConnectionId()))
                         .withHeader("UNLEASH-APPNAME", matching("test-app")));
     }
 
@@ -70,6 +73,10 @@ public class DefaultHttpMetricsSenderTest {
                 postRequestedFor(urlMatching("/client/metrics"))
                         .withRequestBody(matching(".*appName.*"))
                         .withRequestBody(matching(".*bucket.*"))
+                        .withHeader(
+                                UNLEASH_INTERVAL, matching(config.getFetchTogglesIntervalMillis()))
+                        .withHeader(
+                                UNLEASH_CONNECTION_ID_HEADER, matching(config.getConnectionId()))
                         .withHeader("UNLEASH-APPNAME", matching("test-app")));
     }
 
@@ -81,7 +88,13 @@ public class DefaultHttpMetricsSenderTest {
                         .willReturn(aResponse().withStatus(500)));
 
         URI uri = new URI("http://localhost:" + serverMock.getPort());
-        UnleashConfig config = UnleashConfig.builder().appName("test-app").unleashAPI(uri).build();
+        long metricsInterval = 0;
+        UnleashConfig config =
+                UnleashConfig.builder()
+                        .appName("test-app")
+                        .unleashAPI(uri)
+                        .fetchTogglesInterval(metricsInterval)
+                        .build();
 
         DefaultHttpMetricsSender sender = new DefaultHttpMetricsSender(config);
         MetricsBucket bucket = new MetricsBucket(Instant.now(), Instant.now(), null);
@@ -92,6 +105,7 @@ public class DefaultHttpMetricsSenderTest {
                 postRequestedFor(urlMatching("/client/metrics"))
                         .withRequestBody(matching(".*appName.*"))
                         .withRequestBody(matching(".*bucket.*"))
+                        .withHeader(UNLEASH_INTERVAL, matching(String.valueOf(metricsInterval)))
                         .withHeader("UNLEASH-APPNAME", matching("test-app")));
     }
 }
diff --git a/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java b/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java
index 3b839d32..7f89da26 100644
--- a/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java
+++ b/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java
@@ -5,6 +5,7 @@ import static org.mockito.Mockito.*;
 
 import io.getunleash.engine.MetricsBucket;
 import io.getunleash.engine.UnleashEngine;
+import io.getunleash.engine.YggdrasilError;
 import io.getunleash.util.UnleashConfig;
 import io.getunleash.util.UnleashScheduledExecutor;
 import java.time.LocalDateTime;
@@ -114,7 +115,7 @@ public class UnleashMetricServiceImplTest {
     }
 
     @Test
-    public void should_record_and_send_metrics() {
+    public void should_record_and_send_metrics() throws YggdrasilError {
         UnleashConfig config =
                 UnleashConfig.builder()
                         .appName("test")
@@ -149,6 +150,7 @@ public class UnleashMetricServiceImplTest {
         assertThat(clientMetrics.getAppName()).isEqualTo(config.getAppName());
         assertThat(clientMetrics.getEnvironment()).isEqualTo(config.getEnvironment());
         assertThat(clientMetrics.getInstanceId()).isEqualTo(config.getInstanceId());
+        assertThat(clientMetrics.getConnectionId()).isEqualTo(config.getConnectionId());
         assertThat(bucket.getStart()).isNotNull();
         assertThat(bucket.getStop()).isNotNull();
         assertThat(bucket.getToggles()).hasSize(2);
@@ -157,7 +159,7 @@ public class UnleashMetricServiceImplTest {
     }
 
     @Test
-    public void should_record_and_send_variant_metrics() {
+    public void should_record_and_send_variant_metrics() throws YggdrasilError {
         UnleashConfig config =
                 UnleashConfig.builder()
                         .appName("test")
@@ -191,6 +193,7 @@ public class UnleashMetricServiceImplTest {
 
         assertThat(clientMetrics.getAppName()).isEqualTo(config.getAppName());
         assertThat(clientMetrics.getInstanceId()).isEqualTo(config.getInstanceId());
+        assertThat(clientMetrics.getConnectionId()).isEqualTo(config.getConnectionId());
         assertThat(bucket.getStart()).isNotNull();
         assertThat(bucket.getStop()).isNotNull();
         assertThat(bucket.getToggles()).hasSize(1);
@@ -205,7 +208,7 @@ public class UnleashMetricServiceImplTest {
     }
 
     @Test
-    public void should_backoff_when_told_to_by_429_code() {
+    public void should_backoff_when_told_to_by_429_code() throws YggdrasilError {
         UnleashConfig config =
                 UnleashConfig.builder()
                         .appName("test")
@@ -278,7 +281,7 @@ public class UnleashMetricServiceImplTest {
     }
 
     @Test
-    public void server_errors_should_also_incrementally_backoff() {
+    public void server_errors_should_also_incrementally_backoff() throws YggdrasilError {
         UnleashConfig config =
                 UnleashConfig.builder()
                         .appName("test")
@@ -349,7 +352,8 @@ public class UnleashMetricServiceImplTest {
     }
 
     @Test
-    public void failure_to_authenticate_immediately_increases_interval_to_max() {
+    public void failure_to_authenticate_immediately_increases_interval_to_max()
+            throws YggdrasilError {
         UnleashConfig config =
                 UnleashConfig.builder()
                         .appName("test")
@@ -387,7 +391,7 @@ public class UnleashMetricServiceImplTest {
     }
 
     @Test
-    public void url_not_found_immediately_increases_interval_to_max() {
+    public void url_not_found_immediately_increases_interval_to_max() throws YggdrasilError {
         UnleashConfig config =
                 UnleashConfig.builder()
                         .appName("test")
diff --git a/src/test/java/io/getunleash/repository/FeatureRepositoryTest.java b/src/test/java/io/getunleash/repository/FeatureRepositoryTest.java
index 828628bd..52ffcc75 100644
--- a/src/test/java/io/getunleash/repository/FeatureRepositoryTest.java
+++ b/src/test/java/io/getunleash/repository/FeatureRepositoryTest.java
@@ -248,8 +248,8 @@ public class FeatureRepositoryTest {
 
         runner.assertThatFetchesAndReceives(ClientFeaturesResponse.Status.UNAVAILABLE, code);
         assertThat(featureRepository.getFailures()).isEqualTo(1);
-        assertThat(featureRepository.getSkips()).isEqualTo(30);
-        for (int i = 0; i < 30; i++) {
+        assertThat(featureRepository.getSkips()).isEqualTo(20);
+        for (int i = 0; i < 20; i++) {
             runner.assertThatSkipsNextRun();
         }
         assertThat(featureRepository.getFailures()).isEqualTo(1);
diff --git a/src/test/java/io/getunleash/util/UnleashConfigTest.java b/src/test/java/io/getunleash/util/UnleashConfigTest.java
index e0d08e55..9e7c2ae3 100644
--- a/src/test/java/io/getunleash/util/UnleashConfigTest.java
+++ b/src/test/java/io/getunleash/util/UnleashConfigTest.java
@@ -148,7 +148,6 @@ public class UnleashConfigTest {
                         .appName(appName)
                         .instanceId(instanceId)
                         .unleashAPI(unleashAPI)
-                        .customHttpHeader(UNLEASH_CONNECTION_ID_HEADER, "ignore")
                         .build();
 
         URL someUrl = new URL(unleashAPI + "/some/arbitrary/path");
@@ -157,7 +156,10 @@ public class UnleashConfigTest {
         UnleashConfig.setRequestProperties(connection, unleashConfig);
         assertThat(connection.getRequestProperty(UNLEASH_APP_NAME_HEADER)).isEqualTo(appName);
         assertThat(connection.getRequestProperty(UNLEASH_INSTANCE_ID_HEADER)).isEqualTo(instanceId);
-        assertThat(connection.getRequestProperty(UNLEASH_CONNECTION_ID_HEADER)).hasSize(36);
+        assertThat(connection.getRequestProperty(UNLEASH_INTERVAL))
+                .isEqualTo(unleashConfig.getFetchTogglesIntervalMillis());
+        assertThat(connection.getRequestProperty(UNLEASH_CONNECTION_ID_HEADER))
+                .isEqualTo(unleashConfig.getConnectionId());
         assertThat(connection.getRequestProperty(UNLEASH_SDK_HEADER))
                 .isEqualTo("unleash-client-java:development");
         assertThat(connection.getRequestProperty("User-Agent")).isEqualTo(appName);