Skip to content

Commit

Permalink
FFM-12087 Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
erdirowlands committed Oct 3, 2024
1 parent a54afff commit c049617
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ Add the following Maven dependency in your project's pom.xml file:
<dependency>
<groupId>io.harness</groupId>
<artifactId>ff-java-server-sdk</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
```

#### Gradle

```
implementation 'io.harness:ff-java-server-sdk:1.7.0'
implementation 'io.harness:ff-java-server-sdk:1.8.0'
```

### Code Sample
Expand Down
24 changes: 18 additions & 6 deletions examples/src/main/java/io/harness/ff/examples/GettingStarted.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,43 @@
import io.harness.cf.client.connector.HarnessConfig;
import io.harness.cf.client.connector.HarnessConnector;
import io.harness.cf.client.dto.Target;
import org.bouncycastle.jcajce.provider.symmetric.ARC4;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class GettingStarted {
// API Key - set this as an env variable
private static final String apiKey = getEnvOrDefault("FF_API_KEY", "");
private static final String apiKey = "f4704e75-5227-412f-b241-54baff110663";

// Flag Identifier
private static final String flagName = getEnvOrDefault("FF_FLAG_NAME", "harnessappdemodarkmode");
private static final String flagName = getEnvOrDefault("FF_FLAG_NAME", "flushme");

private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);

public static void main(String[] args) {
System.out.println("Harness SDK Getting Started");

HarnessConfig harnessConfig =
HarnessConfig.builder().flushAnalyticsOnCloseTimeout(1000).build();
final HarnessConnector connector = new HarnessConnector(apiKey, HarnessConfig.builder()
//.configUrl("http://localhost:8000/api/1.0")
//.eventUrl("http://localhost:8001/api/1.0")
.configUrl("http://localhost:8003/api/1.0")
.eventUrl("http://localhost:8003/api/1.0")
// .maxRequestRetry(20)
.flushAnalyticsOnCloseTimeout(1000)
.build());


final BaseConfig baseConfig = BaseConfig.builder().
analyticsEnabled(true).
streamEnabled(true).
flushAnalyticsOnClose(true).
build();

// Create a Feature Flag Client
// try-with-resources is used here to automatically close the client when this block is exited
try (CfClient cfClient = new CfClient(connector)) {
try (CfClient cfClient = new CfClient(connector, baseConfig)) {
cfClient.waitForInitialization();

// Create a target (different targets can get different results based on rules. This includes a custom attribute 'location')
Expand All @@ -48,7 +60,7 @@ public static void main(String[] args) {
TimeUnit.SECONDS);

// SDK will exit after 15 minutes, this gives the example time to stream events
TimeUnit.MINUTES.sleep(15);
TimeUnit.SECONDS.sleep(3);

// Close the SDK
System.out.println("Cleaning up...");
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencyResolutionManagement {
versionCatalogs {
libs {
// main sdk version
version('sdk', '1.7.0');
version('sdk', '1.8.0');

// sdk deps
version('okhttp3', '4.12.0')
Expand Down

0 comments on commit c049617

Please sign in to comment.