Spring Cloud

이미연·2024λ…„ 7μ›” 31일

[spring]

λͺ©λ‘ 보기
1/7

πŸ”Ž Spring Cloud:

Spring CloudλŠ” λΆ„μ‚° μ‹œμŠ€ν…œ(특히 λ§ˆμ΄ν¬λ‘œμ„œλΉ„μŠ€)을 λΉ λ₯΄κ²Œ ꡬ좕할 수 μžˆλ„λ‘ λ„μ™€μ£ΌλŠ” 도ꡬ λͺ¨μŒμž…λ‹ˆλ‹€.
μ΄λŠ” Spring Boot μœ„μ— κ΅¬μΆ•λ˜μ–΄ 있으며, ν΄λΌμš°λ“œ λ„€μ΄ν‹°λΈŒ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ κ°œλ°œμ„ μœ„ν•œ λ‹€μ–‘ν•œ νŒ¨ν„΄μ„ μ œκ³΅ν•©λ‹ˆλ‹€.

πŸ”Ž μ£Όμš” μ»΄ν¬λ„ŒνŠΈμ™€ κΈ°λŠ₯:

πŸ’‘ μ„œλΉ„μŠ€ λ””μŠ€μ»€λ²„λ¦¬ (Service Discovery)

Netflix Eureka: μ„œλΉ„μŠ€ 등둝 및 λ°œκ²¬μ„ μœ„ν•œ μ„œλ²„μ™€ ν΄λΌμ΄μ–ΈνŠΈλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.

@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(EurekaServerApplication.class, args);
    }
}

πŸ’‘ λ‘œλ“œ λ°ΈλŸ°μ‹± (Load Balancing)

Ribbon: ν΄λΌμ΄μ–ΈνŠΈ μΈ‘ λ‘œλ“œ λ°ΈλŸ°μ„œλ‘œ, μ„œλΉ„μŠ€ μΈμŠ€ν„΄μŠ€ κ°„μ˜ μš”μ²­μ„ λΆ„μ‚°μ‹œν‚΅λ‹ˆλ‹€.

πŸ’‘ API κ²Œμ΄νŠΈμ›¨μ΄ (API Gateway)

Spring Cloud Gateway: λΌμš°νŒ…, 필터링, λ‘œλ“œ λ°ΈλŸ°μ‹± 등을 μ œκ³΅ν•©λ‹ˆλ‹€.

@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApplication {
    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);
    }
}

πŸ’‘ μ„œν‚· 브레이컀 (Circuit Breaker)

Hystrix: μž₯μ•  격리와 볡원λ ₯을 μ œκ³΅ν•©λ‹ˆλ‹€.

@HystrixCommand(fallbackMethod = "fallbackMethod")
public String someMethod() {
    // μ›λž˜ 둜직
}

public String fallbackMethod() {
    return "Fallback response";
}

πŸ’‘ λΆ„μ‚° μ„€μ • 관리 (Distributed Configuration)

Spring Cloud Config: 쀑앙 집쀑식 μ™ΈλΆ€ μ„€μ • 관리λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.

πŸ’‘ λΆ„μ‚° 좔적 (Distributed Tracing)

Spring Cloud Sleuth: λ§ˆμ΄ν¬λ‘œμ„œλΉ„μŠ€ κ°„μ˜ μš”μ²­ 흐름을 μΆ”μ ν•©λ‹ˆλ‹€.


πŸ’‘ λ©”μ‹œμ§• (Messaging)

Spring Cloud Stream: λ©”μ‹œμ§€ 기반 λ§ˆμ΄ν¬λ‘œμ„œλΉ„μŠ€λ₯Ό μ‰½κ²Œ ꡬ좕할 수 있게 ν•΄μ€λ‹ˆλ‹€.

1개의 λŒ“κΈ€

comment-user-thumbnail
2024λ…„ 8μ›” 1일

TIL λ„ˆλ¬΄ 잘 μž‘μ„±ν•΄μ£Όμ…¨κ΅°μš”! μ•žμœΌλ‘œλ„ κΎΈμ€€νžˆ μž‘μ„±ν•΄λ³΄μ•„μš”~!

λ‹΅κΈ€ 달기