diff --git a/놀이터(예제 코드 작성)/spring-cloud-open-feign/README.md b/놀이터(예제 코드 작성)/spring-cloud-open-feign/README.md index 8cddc2f..4593f4f 100644 --- a/놀이터(예제 코드 작성)/spring-cloud-open-feign/README.md +++ b/놀이터(예제 코드 작성)/spring-cloud-open-feign/README.md @@ -22,3 +22,4 @@ - [GitHub - OpenFeign/feign](https://github.com/OpenFeign/feign) - [Java Jackson JSON Library](https://kwonnam.pe.kr/wiki/java/jackson) - [{JSON} Placeholder](https://jsonplaceholder.typicode.com/) +- [Spring Cloud Openfeign](https://brunch.co.kr/@springboot/202) diff --git a/놀이터(예제 코드 작성)/spring-cloud-open-feign/src/main/kotlin/com/banjjoknim/springcloudopenfeign/domain/PostClient.kt b/놀이터(예제 코드 작성)/spring-cloud-open-feign/src/main/kotlin/com/banjjoknim/springcloudopenfeign/domain/PostClient.kt index 73a1e20..2e96343 100644 --- a/놀이터(예제 코드 작성)/spring-cloud-open-feign/src/main/kotlin/com/banjjoknim/springcloudopenfeign/domain/PostClient.kt +++ b/놀이터(예제 코드 작성)/spring-cloud-open-feign/src/main/kotlin/com/banjjoknim/springcloudopenfeign/domain/PostClient.kt @@ -4,6 +4,19 @@ import org.springframework.cloud.openfeign.FeignClient import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable +/** + * Feign is a declarative web service client. It makes writing web service clients easier. + * To use Feign create an interface and annotate it. + * It has pluggable annotation support including Feign annotations and JAX-RS annotations. + * Feign also supports pluggable encoders and decoders. + * Spring Cloud adds support for Spring MVC annotations and for using the same HttpMessageConverters used by default in Spring Web. + * Spring Cloud integrates Eureka, as well as Spring Cloud LoadBalancer to provide a load-balanced http client when using Feign. + * + * 쉽게 말하면 RestTemplate, RestClient 등의 `HTTP Client`를 어노테이션으로 선언하여 사용하는 것이라 생각하면 된다. + * 인터페이스를 만들고 @FeignClient 를 선언하기만 하면 구현체는 런타임에 알아서 만들어진다. + * + * @see org.springframework.cloud.openfeign.FeignClient + */ @FeignClient(value = "post", url = "https://jsonplaceholder.typicode.com/") interface PostClient {