spring-cloud-config
FreeNo executable scriptsNot checkedSpring Cloud Config for centralized configuration management in microservices. Covers Config Server, Config Client, Git backend, and dynamic refresh. USE…
by claude-dev-suite★ 51 GitHub starsAbout this skill
Spring Cloud Config - Quick Reference
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:spring-cloud-configfor comprehensive documentation.
Config Server Setup
Dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
Main Application
@SpringBootApplication
@EnableConfigServer
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}
application.yml (Server)
server:
port: 8888
spring:
application:
name: config-server
cloud:
config:
server:
git:
uri: https://github.com/myorg/config-repo
default-label: main
search-paths: '{application}'
clone-on-start: true
timeout: 10
# For private repos
username: ${GIT_USERNAME}
password: ${GIT_TOKEN}
# Multiple repositories
# git:
# uri: https://github.com/myorg/default-config
# repos:
# user-service:
# pattern: user-*
# uri: https://github.com/myorg/user-config
# Security
management:
endpoints:
web:
exposure:
include: health,refresh
Native Filesystem Backend
spring:
profiles:
active: native
cloud:
config:
server:
native:
search-locations:
- classpath:/config
- file:///config-repo
Config Client Setup
Dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
application.yml (Client)
spring:
application:
name: user-service
config:
import: optional:configserver:http://localhost:8888
cloud:
config:
fail-fast: true
retry:
initial-interval: 1000
max-interval: 2000
max-attempts: 6
multiplier: 1.1
label: main # Git branch
# For service discovery
# spring:
# config:
# import: optional:configserver:
# cloud:
# config:
# discovery:
# enabled: true
# service-id: config-server
Config Repository Structure
config-repo/
├── application.yml # Shared by all apps
├── application-dev.yml # Shared dev profile
├── application-prod.yml # Shared prod profile
├── user-service.yml # user-service defaults
├── user-service-dev.yml # user-service dev
├── user-service-prod.yml # user-service prod
├── order-service.yml
└── order-service-prod.yml
Example: user-service.yml
# Base configuration
server:
port: 8081
app:
name: User Service
feature-flags:
new-dashboard: false
beta-features: false
database:
pool-size: 10
timeout: 5000
Example: user-service-prod.yml
# Production overrides
server:
port: 80
app:
feature-flags:
new-dashboard: true
database:
pool-size: 50
timeout: 3000
Accessing Configuration
REST Endpoints
# Get configuration
GET http://localhost:8888/{application}/{profile}
GET http://localhost:8888/{application}/{profile}/{label}
# Examples
GET http://localhost:8888/user-service/default
GET http://localhost:8888/user-service/prod
GET http://localhost:8888/user-service/prod/main
# Get specific file
GET http://localhost:8888/{application}/{profile}/{label}/{filename}
Dynamic Refresh
Enable Refresh
management:
endpoints:
web:
exposure:
include: refresh,health,info
@RefreshScope
@RestController
@RefreshScope
public class ConfigController {
@Value("${app.feature-flags.new-dashboard}")
private boolean newDashboard;
@Value("${app.name}")
private String appName;
@GetMapping("/config")
public Map<String, Object> getConfig() {
return Map.of(
"appName", appName,
"newDashboard", newDashboard
);
}
}
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "app")
public class AppConfig {
private String name;
private Map<String, Boolean> featureFlags;
// getters, setters
}
Trigger Refresh
# Single service
POST http://localhost:8081/actuator/refresh
# Response: changed properties
["app.feature-flags.new-dashboard", "app.name"]
Spring Cloud Bus (Broadcast Refresh)
Dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<!-- or Kafka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-kafka</artifactId>
</dependency>
Configuration
Install spring-cloud-config in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
ReadGrepGlobWriteEditFAQ
What does the spring-cloud-config skill do?
Spring Cloud Config for centralized configuration management in microservices. Covers Config Server, Config Client, Git backend, and dynamic refresh. USE WHEN: user mentions "spring cloud config", "config server", "centralized configuration", "@RefreshScope", "externalized config" DO NOT USE FOR: simple properties files - use standard Spring Boot, secrets management - combine with Vault
How do I install the spring-cloud-config skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the spring-cloud-config skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic