π 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: λ©μμ§ κΈ°λ° λ§μ΄ν¬λ‘μλΉμ€λ₯Ό μ½κ² ꡬμΆν μ μκ² ν΄μ€λλ€.
TIL λ무 μ μμ±ν΄μ£Όμ ¨κ΅°μ! μμΌλ‘λ κΎΈμ€ν μμ±ν΄λ³΄μμ~!