{"id":15659047,"url":"https://github.com/v5tech/spring-boot-apollo-sample","last_synced_at":"2025-05-05T17:13:23.761Z","repository":{"id":149461777,"uuid":"96760294","full_name":"v5tech/spring-boot-apollo-sample","owner":"v5tech","description":"Demo project for Spring Boot Apollo","archived":false,"fork":false,"pushed_at":"2017-07-12T02:57:16.000Z","size":5108,"stargazers_count":21,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T22:32:28.030Z","etag":null,"topics":["apollo","spring-boot","spring-boot-apollo-sample"],"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/v5tech.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}},"created_at":"2017-07-10T09:32:14.000Z","updated_at":"2024-07-10T07:57:45.000Z","dependencies_parsed_at":"2023-04-19T03:16:32.871Z","dependency_job_id":null,"html_url":"https://github.com/v5tech/spring-boot-apollo-sample","commit_stats":null,"previous_names":["v5tech/spring-boot-apollo-sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-apollo-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-apollo-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-apollo-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v5tech%2Fspring-boot-apollo-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v5tech","download_url":"https://codeload.github.com/v5tech/spring-boot-apollo-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252542068,"owners_count":21764907,"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":["apollo","spring-boot","spring-boot-apollo-sample"],"created_at":"2024-10-03T13:14:45.782Z","updated_at":"2025-05-05T17:13:23.722Z","avatar_url":"https://github.com/v5tech.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spring-boot-apollo-sample\nDemo project for Spring Boot Apollo\n\nSpring Boot整合携程Apollo配置中心\n\n## 客户端maven配置\n\n* apollo-client(必须)\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.ctrip.framework.apollo\u003c/groupId\u003e\n    \u003cartifactId\u003eapollo-client\u003c/artifactId\u003e\n    \u003cversion\u003e0.8.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n* spring-boot-starter-actuator 和 spring-cloud-context\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-actuator\u003c/artifactId\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n    \u003cartifactId\u003espring-cloud-context\u003c/artifactId\u003e\n    \u003cversion\u003e1.2.2.RELEASE\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n注意:\n\n1、`apollo-client`为必须配置\n\n2、`spring-boot-starter-actuator` 和 `spring-cloud-context`为可选配置。仅在使用`Spring Cloud`的`@RefreshScope`时所需\n\n## 客户端使用\n\n![](Screenshots/6B4E9E4C-2744-4B76-B1BA-21343CAC0508.png)\n\n* Java Config结合Spring Placeholder方式\n\n详见JavaConfigSample。JavaConfigSample使用`Config API`实现属性值变动实时修改\n\n![](Screenshots/1.gif)\n\n* Spring Boot ConfigurationProperties方式\n\n详见ConfigurationPropertiesSample。\n\nConfigurationPropertiesSample并没有使用`Config API`实现属性值变动实时修改，而是采用`Spring Cloud`的`@RefreshScope`注解和`/refresh`端点来刷新属性值\n\n![](Screenshots/2.gif)\n\n注:本示例代码所有配置属性在Apollo配置中心修改后立即生效。\n\n\n# 参考文档\n\nhttps://github.com/ctripcorp/apollo/wiki/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv5tech%2Fspring-boot-apollo-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv5tech%2Fspring-boot-apollo-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv5tech%2Fspring-boot-apollo-sample/lists"}