Merge pull request #10857 from MicuEmerson/master

BAEL-4014 - added the code
This commit is contained in:
davidmartinezbarua 2021-07-09 14:51:09 -03:00 committed by GitHub
commit fe8ec4460c
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,13 @@
package com.baeldung.cloud.openfeign.client;
import com.baeldung.cloud.openfeign.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient(name = "user-client", url="https://jsonplaceholder.typicode.com", configuration = FeignConfig.class)
public interface UserClient {
@RequestMapping(value = "/users", method = RequestMethod.GET)
String getUsers();
}

View File

@ -0,0 +1,12 @@
package com.baeldung.cloud.openfeign.config;
import feign.Logger;
import org.springframework.context.annotation.Bean;
public class FeignConfig {
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
}