Merge pull request #10857 from MicuEmerson/master
BAEL-4014 - added the code
This commit is contained in:
commit
fe8ec4460c
|
@ -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();
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue