BAEL-4014 - added the code

This commit is contained in:
MicuEmerson 2021-06-02 20:57:42 +03:00
parent 9c787a2a6c
commit 4407da95c1
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;
}
}