{"id":26514888,"url":"https://github.com/devcyclehq/java-server-sdk","last_synced_at":"2025-03-21T05:29:42.040Z","repository":{"id":37537664,"uuid":"431691849","full_name":"DevCycleHQ/java-server-sdk","owner":"DevCycleHQ","description":"DevCycle - Java Server SDK","archived":false,"fork":false,"pushed_at":"2025-02-12T19:22:52.000Z","size":1490,"stargazers_count":20,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-02-12T20:27:30.911Z","etag":null,"topics":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"latest_commit_sha":null,"homepage":"https://docs.devcycle.com/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevCycleHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-25T02:38:18.000Z","updated_at":"2025-01-21T16:42:43.000Z","dependencies_parsed_at":"2023-10-24T16:43:52.570Z","dependency_job_id":"d7e90f76-2411-4b3d-a6cb-d63e72e6a711","html_url":"https://github.com/DevCycleHQ/java-server-sdk","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fjava-server-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fjava-server-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fjava-server-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fjava-server-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevCycleHQ","download_url":"https://codeload.github.com/DevCycleHQ/java-server-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745219,"owners_count":20503040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"created_at":"2025-03-21T05:29:41.368Z","updated_at":"2025-03-21T05:29:41.949Z","avatar_url":"https://github.com/DevCycleHQ.png","language":"Java","readme":"# DevCycle Java Server SDK\n\nWelcome to the DevCycle Java Server SDK, providing feature flag functionality via [Local Bucketing](https://docs.devcycle.com/sdk/#difference-between-local-and-cloud-bucketing) or Cloud Bucket through the [DevCycle Bucketing API](https://docs.devcycle.com/bucketing-api/#tag/devcycle). \n\n## Requirements\n\nThis version of the DevCycle SDK works with Java 11 and above.\n\nUsing the Java SDK library requires [Maven](https://maven.apache.org/) or [Gradle](https://gradle.org/) \u003e= 7.6+ to be installed.\n\nAn x86_64 or aarch64 JDK is required for Local Bucketing with the DevCycle Java SDK.\n\nCurrently Supported Platforms are:\n\n| OS             | Arch      |\n|----------------|-----------|\n| Linux (ELF)    | x86_64    |\n| Linux (ELF)    | aarch64   |\n| Mac OS         | x86_64    |\n| Mac OS         | aarch64   |\n| Windows        | x86_64    |\n\nIn addition, the environment must support GLIBC v2.16 or higher.  You can use the following command to check your GLIBC version:\n\n```bash\nldd --version\n``` \n\n## Installation\n\n### Gradle\nYou can use the SDK in your Gradle project by adding the following to *build.gradle*:\n\n```yaml\nimplementation(\"com.devcycle:java-server-sdk:2.6.0\")\n```\n\n### Maven\n\nYou can use the SDK in your Maven project by adding the following to your *pom.xml*:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.devcycle\u003c/groupId\u003e\n    \u003cartifactId\u003ejava-server-sdk\u003c/artifactId\u003e\n    \u003cversion\u003e2.6.0\u003c/version\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n## DNS Caching\nThe JVM, by default, caches DNS for infinity. DevCycle servers are load balanced and dynamic. To address this concern,\nsetting the DNS cache TTL to a short duration is recommended. The TTL is controlled by this security setting `networkaddress.cache.ttl`.\nRecommended settings and how to configure them can be found [here](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html).\n\n## Getting Started\n\nTo use the DevCycle Java SDK, initialize a client object. \n\nCloud:\n```java\nimport com.devcycle.sdk.server.cloud.api.DevCycleCloudClient;\n\npublic class MyClass {\n\n    private DevCycleCloudClient dvcCloudClient;\n\n    public MyClass() {\n        dvcCloudClient = new DevCycleCloudClient(\"DEVCYCLE_SERVER_SDK_KEY\");\n    }\n}\n```\n\nLocal:\n```java\nimport com.devcycle.sdk.server.local.api.DevCycleLocalClient;\n\npublic class MyClass {\n    \n    private DevCycleLocalClient dvcLocalClient;\n    \n    public MyClass() {\n        dvcLocalClient = new DevCycleLocalClient(\"DEVCYCLE_SERVER_SDK_KEY\");\n    }\n}\n```\n\n## OpenFeature Support\n\nThis SDK provides an implementation of the [OpenFeature](https://openfeature.dev/) Provider interface. Use the `getOpenFeatureProvider()` method on the DevCycle SDK client to obtain a provider for OpenFeature.\n\n```java\nDevCycleLocalClient devCycleClient = new DevCycleLocalClient(\"DEVCYCLE_SERVER_SDK_KEY\", options);\nOpenFeatureAPI api = OpenFeatureAPI.getInstance();\napi.setProvider(devCycleClient.getOpenFeatureProvider());\n```\n\nYou can find additional instructions on how to use it here: [DevCycle Java SDK OpenFeature Provider](OpenFeature.md)\n\n## Usage\n\nTo find usage documentation, visit our docs for [Local Bucketing](https://docs.devcycle.com/sdk/server-side-sdks/java-local/java-local-usage) and [Cloud Bucketing](https://docs.devcycle.com/sdk/server-side-sdks/java-cloud/java-cloud-usage)\n\n## Logging\n\nThe DevCycle SDK logs to **stdout** by default and does not require any specific logging package. To integrate with your \nown logging system, such as Java Logging or SLF4J, you can create a wrapper that implements the `IDevCycleLogger` interface. \nThen you can set the logger into the Java Server SDK setting the Custom Logger property in the options object used to \ninitialize the client.\n\n```java\n// Create your logging wrapper\nIDevCycleLogger loggingWrapper = new IDevCycleLogger() {\n    @Override\n    public void debug(String message) {\n        // Your logging implementation here\n    }\n\n    @Override\n    public void info(String message) {\n        // Your logging implementation here\n    }\n\n    @Override\n    public void warning(String message) {\n        // Your logging implementation here\n    }\n\n    @Override\n    public void error(String message) {\n        // Your logging implementation here\n    }\n\n    @Override\n    public void error(String message, Throwable throwable) {\n        // Your logging implementation here\n    }\n};\n\n// Set the logger in the options before creating the DevCycleLocalClient\nDevCycleLocalOptions options = DevCycleLocalOptions.builder().customLogger(loggingWrapper).build();\nDevCycleLocalClient dvcClient = new DevCycleLocalClient(\"DEVCYCLE_SERVER_SDK_KEY\", options);\n\n// Or for DevCycleCloudClient\nDevCycleCloudOptions options = DevCycleCloudOptions.builder().customLogger(loggingWrapper).build();\nDevCycleCloudClient dvcClient = new DevCycleCloudClient(\"DEVCYCLE_SERVER_SDK_KEY\", options);\n```\n\nYou can also disable all logging by setting the custom logger to `new SimpleDevCycleLogger(SimpleDevCycleLogger.Level.OFF)`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Fjava-server-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcyclehq%2Fjava-server-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Fjava-server-sdk/lists"}