spring-cloud-eureka
БесплатноБез исполняемых скриптовНе проверенNetflix Eureka for service discovery in Spring Cloud microservices. Covers Eureka Server, Eureka Client, registration, and health checks. USE WHEN: user…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Spring Cloud Eureka - Quick Reference
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:spring-cloud-eurekafor comprehensive documentation.
Eureka Server Setup
Dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
Main Application
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
application.yml (Server)
server:
port: 8761
spring:
application:
name: eureka-server
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false # Don't register itself
fetch-registry: false # Don't fetch registry
service-url:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
enable-self-preservation: true
eviction-interval-timer-in-ms: 5000
renewal-percent-threshold: 0.85
High Availability (Peer Replication)
# eureka-server-1
server:
port: 8761
eureka:
instance:
hostname: eureka1.mycompany.com
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://eureka2.mycompany.com:8762/eureka/,http://eureka3.mycompany.com:8763/eureka/
---
# eureka-server-2
server:
port: 8762
eureka:
instance:
hostname: eureka2.mycompany.com
client:
service-url:
defaultZone: http://eureka1.mycompany.com:8761/eureka/,http://eureka3.mycompany.com:8763/eureka/
Eureka Client Setup
Dependencies
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
application.yml (Client)
spring:
application:
name: user-service
server:
port: 8081
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
registry-fetch-interval-seconds: 5
initial-instance-info-replication-interval-seconds: 5
instance:
instance-id: ${spring.application.name}:${random.value}
prefer-ip-address: true
lease-renewal-interval-in-seconds: 10
lease-expiration-duration-in-seconds: 30
metadata-map:
version: ${project.version:unknown}
zone: zone-a
Instance Health
eureka:
instance:
health-check-url-path: /actuator/health
status-page-url-path: /actuator/info
Service Discovery
Using DiscoveryClient
@Service
@RequiredArgsConstructor
public class ServiceDiscoveryService {
private final DiscoveryClient discoveryClient;
public List<ServiceInstance> getInstances(String serviceName) {
return discoveryClient.getInstances(serviceName);
}
public String getServiceUrl(String serviceName) {
List<ServiceInstance> instances = discoveryClient.getInstances(serviceName);
if (instances.isEmpty()) {
throw new ServiceNotFoundException(serviceName);
}
// Simple random selection
ServiceInstance instance = instances.get(
ThreadLocalRandom.current().nextInt(instances.size()));
return instance.getUri().toString();
}
public List<String> getAllServices() {
return discoveryClient.getServices();
}
}
Using RestTemplate with LoadBalancer
@Configuration
public class RestTemplateConfig {
@Bean
@LoadBalanced
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
@Service
@RequiredArgsConstructor
public class UserClient {
private final RestTemplate restTemplate;
public User getUser(Long id) {
// Uses service name instead of hostname
return restTemplate.getForObject(
"http://USER-SERVICE/api/users/{id}",
User.class, id);
}
}
Using WebClient with LoadBalancer
@Configuration
public class WebClientConfig {
@Bean
@LoadBalanced
public WebClient.Builder webClientBuilder() {
return WebClient.builder();
}
}
@Service
public class UserWebClient {
private final WebClient webClient;
public UserWebClient(WebClient.Builder builder) {
this.webClient = builder.baseUrl("http://USER-SERVICE").build();
}
public Mono<User> getUser(Long id) {
return webClient.get()
.uri("/api/users/{id}", id)
.retrieve()
.bodyToMono(User.class);
}
}
Custom Load Balancer
@Configuration
public class CustomLoadBalancerConfig {
@Bean
public ReactorLoadBalancer<ServiceInstance> customLoadBalancer(
Environment environment,
LoadBalancerClientFactory clientFactory) {
String name = environment.getProperty(LoadBalancerClientFactory.PROPERTY_NAME);
return new RoundRobinLoadBalancer(
clientF
Установить spring-cloud-eureka в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл spring-cloud-eureka?
Netflix Eureka for service discovery in Spring Cloud microservices. Covers Eureka Server, Eureka Client, registration, and health checks. USE WHEN: user mentions "eureka", "service discovery", "service registry", "@EnableEurekaServer", "@EnableDiscoveryClient", "eureka dashboard" DO NOT USE FOR: Kubernetes service discovery - use native K8s, Consul - use Consul-specific patterns
Как установить скилл spring-cloud-eureka?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spring-cloud-eureka запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от 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…
от Anthropic