{"id":18879313,"url":"https://github.com/jdk-plus/spring-boot-starter-etcd","last_synced_at":"2026-02-20T00:30:16.021Z","repository":{"id":167163529,"uuid":"642726302","full_name":"JDK-Plus/spring-boot-starter-etcd","owner":"JDK-Plus","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-19T08:13:16.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-31T02:43:54.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JDK-Plus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-05-19T07:58:01.000Z","updated_at":"2024-12-12T07:50:51.000Z","dependencies_parsed_at":"2024-02-23T18:00:17.178Z","dependency_job_id":null,"html_url":"https://github.com/JDK-Plus/spring-boot-starter-etcd","commit_stats":null,"previous_names":["jdk-plus/spring-boot-starter-etcd"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDK-Plus%2Fspring-boot-starter-etcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDK-Plus%2Fspring-boot-starter-etcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDK-Plus%2Fspring-boot-starter-etcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDK-Plus%2Fspring-boot-starter-etcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDK-Plus","download_url":"https://codeload.github.com/JDK-Plus/spring-boot-starter-etcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239841743,"owners_count":19705981,"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":[],"created_at":"2024-11-08T06:35:12.858Z","updated_at":"2026-02-20T00:30:15.977Z","avatar_url":"https://github.com/JDK-Plus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### 一、如何引入\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eplus.jdk\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-etcd\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.6\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### 二、etcd的引用配置\n\n```bash\nplus.jdk.etcd.enabled=true\nplus.jdk.etcd.user-name=admin\nplus.jdk.etcd.password=123456\nplus.jdk.etcd.endpoints=http://ip1:2379,http://ip2:2379,http://ip3:2379\n```\n\n\u003e java 使用etcd不建议使用证书,因为`SslContext Builder`只支持PEM格式的[PKCS#8](https://github.com/etcd-io/jetcd/blob/main/docs/SslConfig.md)私钥文件。\n\n### 三、在项目中引用\n\n下面给出一个使用示例。\n\n```java\nimport lombok.extern.slf4j.Slf4j;\nimport plus.jdk.etcd.annotation.EtcdNode;\nimport plus.jdk.etcd.global.EtcdClient;\nimport plus.jdk.scheduled.annotation.Scheduled;\nimport plus.jdk.scheduled.global.IScheduled;\n\nimport javax.annotation.Resource;\nimport java.lang.management.ManagementFactory;\nimport java.lang.management.OperatingSystemMXBean;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Random;\nimport java.util.concurrent.ArrayBlockingQueue;\nimport java.util.concurrent.ThreadPoolExecutor;\nimport java.util.concurrent.TimeUnit;\n\n@Slf4j\n@Scheduled(expr = \"0/1 * * * * *\")\npublic class LoadAverageScheduledTask extends IScheduled {\n\n\n    @EtcdNode(path = \"/example/system/aim/loadAverage\")\n    private volatile double maxLoadAverage = 2.0;\n\n    @EtcdNode(path = \"/example/system/aim/random/length\")\n    private volatile int maxRandomLen = 500000;\n\n    @Resource\n    private EtcdClient etcdClient;\n\n    private final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 200,\n            0, TimeUnit.SECONDS,\n            new ArrayBlockingQueue\u003c\u003e(200));\n\n    @Override\n    protected void doInCronJob() {\n        String data = etcdClient.getFirstKV(\"/example\", String.class);\n    }\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdk-plus%2Fspring-boot-starter-etcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdk-plus%2Fspring-boot-starter-etcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdk-plus%2Fspring-boot-starter-etcd/lists"}