MSA 환경에서 서비스 간 통신 방법
💡FeignClient
- REST API 호출을 위한 선언적(declarative) HTTP 클라이언트
@FeignClient(name = "productClient", url = "http://localhost:8080")
public interface ProductClient {
@GetMapping("/products")
List<Product> getProducts();
}
💡WebClient
- Spring 5에서 도입된 리액티브(reactive) HTTP 클라이언트
WebClient.create("http://localhost:8080")
.get()
.uri("/products")
.retrieve()
.bodyToFlux(Product.class);
출처
https://www.baeldung.com/spring-boot-feignclient-vs-webclient
'심화 > MSA' 카테고리의 다른 글
| [MSA] Spring Cloud Config Client 동작 구조 (with Spring Docs) (0) | 2026.02.09 |
|---|---|
| [MSA] RabbitMQ (0) | 2025.11.25 |
| [대규모 스트림 처리] 수백만 명의 사용자가 동시에 접속하는 시스템을 어떻게 만들지? (0) | 2025.11.18 |
| [Zipkin] 분산 추적 시스템 (업데이트 중..) (0) | 2025.11.12 |
| [IntelliJ] DSM(Dependency Structure Matrix) (0) | 2025.11.06 |