Feign

EnableFeignClients makes Spring not able to load the context

馋奶兔 提交于 2021-02-19 07:22:54
问题 I have only one Feign client annotated as follow : @FeignClient(name = "billetClient", fallback = BilletClientFallback.class, url = "${services.billeterie.url}") Here is my config class : @Configuration @EnableDiscoveryClient @EnableFeignClients(basePackageClasses = {BilletClient.class}) @ComponentScan(basePackageClasses = {BilletClient.class}) public class FeignConfig { @Bean public static Request.Options requestOptions(ConfigurableEnvironment env) { int ribbonReadTimeout = env.getProperty(

EnableFeignClients makes Spring not able to load the context

ε祈祈猫儿з 提交于 2021-02-19 07:20:19
问题 I have only one Feign client annotated as follow : @FeignClient(name = "billetClient", fallback = BilletClientFallback.class, url = "${services.billeterie.url}") Here is my config class : @Configuration @EnableDiscoveryClient @EnableFeignClients(basePackageClasses = {BilletClient.class}) @ComponentScan(basePackageClasses = {BilletClient.class}) public class FeignConfig { @Bean public static Request.Options requestOptions(ConfigurableEnvironment env) { int ribbonReadTimeout = env.getProperty(

Error only with maven: NoClassDefFoundError: feign/codec/Encoder

白昼怎懂夜的黑 提交于 2021-02-05 11:26:27
问题 I created a project in Eclipse with the Maven wizard and edited the pom.xml file to include my dependencies. My project, which uses Open Feign, builds and runs in Eclipse, but I get the following runtime error when I build it at the command line with Maven: Error: Unable to initialize main class edu.mills.cs180a.BookRepositoryImplFeign Caused by: java.lang.NoClassDefFoundError: feign/codec/Encoder Here is my pom.xml file: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/

Error only with maven: NoClassDefFoundError: feign/codec/Encoder

别说谁变了你拦得住时间么 提交于 2021-02-05 11:26:10
问题 I created a project in Eclipse with the Maven wizard and edited the pom.xml file to include my dependencies. My project, which uses Open Feign, builds and runs in Eclipse, but I get the following runtime error when I build it at the command line with Maven: Error: Unable to initialize main class edu.mills.cs180a.BookRepositoryImplFeign Caused by: java.lang.NoClassDefFoundError: feign/codec/Encoder Here is my pom.xml file: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/

Feign Client fails to compile, it treats BindingResult as a second Body parameter

走远了吗. 提交于 2021-01-28 19:33:30
问题 I'm learning to use Spring's Feign Client, so I've built two simple projects (serviceA and serviceB) to test it out. I have the following code: serviceA rest interface: @RequestMapping("/users") public interface UserRest { @PostMapping public ResponseEntity<User> createUser(@Valid @RequestBody User user, BindingResult br); } serviceA rest interface implementation: @RestController public class UserController implements UserRest { @Override @PostMapping public ResponseEntity<User> createUser(

How to disable hystrix in one of multiple feign clients

江枫思渺然 提交于 2021-01-28 02:50:37
问题 In my spring boot application I use multiple feign clients (@FeignClient("hello-service")). In the case of many of them, I need a mechanism of circuit breaker, so I have following line to the configuration. feign.hystrix.enabled=true However I'don't know how I can configure specific feign client not to use Hystrix. Is it possible? Has anyone managed to configure the spring applications in this way? 回答1: You can create you own configuration with disabled hystrix functionality, and use it for

How can I unmarshal an XML response to 2 java objects using JAXB when there are 2 namespaces?

杀马特。学长 韩版系。学妹 提交于 2021-01-07 02:53:42
问题 Thank you for taking the time to read. My goal is to deserialize the response from an API request into 2 usable java objects. I am sending an POST request to an endpoint to create a job in our schedule. The job is created successfully and the following XML is returned in the body: <entry xmlns="http://purl.org/atom/ns#"> <id>0</id> <title>Job has been created.</title> <source>com.tidalsoft.framework.rpc.Result</source> <tes:result xmlns:tes="http://www.auto-schedule.com/client"> <tes:message

How can I unmarshal an XML response to 2 java objects using JAXB when there are 2 namespaces?

佐手、 提交于 2021-01-07 02:51:12
问题 Thank you for taking the time to read. My goal is to deserialize the response from an API request into 2 usable java objects. I am sending an POST request to an endpoint to create a job in our schedule. The job is created successfully and the following XML is returned in the body: <entry xmlns="http://purl.org/atom/ns#"> <id>0</id> <title>Job has been created.</title> <source>com.tidalsoft.framework.rpc.Result</source> <tes:result xmlns:tes="http://www.auto-schedule.com/client"> <tes:message

Spring Cloud Feign Client @RequestParam with List parameter creates a wrong request

[亡魂溺海] 提交于 2021-01-02 06:06:29
问题 I have a Spring Clound Feign Client mapping defined as following @RequestMapping(method = RequestMethod.GET, value = "/search/findByIdIn") Resources<MyClass> get(@RequestParam("ids") List<Long> ids); when I call feignClient.get(Arrays.asList(1L,2L,3L)) according to what I can see in the debugger, the feign-core library forms the following request: /search/findByIdIn?ids=1&ids=2&ids=3 instead of expected /search/findByIdIn?ids=1,2,3 which would be correct for the server Spring Data REST

How to send a SOAP object with FEIGN client?

我是研究僧i 提交于 2020-12-15 05:15:08
问题 I'm trying to send a SOAP message via a FEIGN client. The problem is that when I send the java object, what is actually being sent is a request with an xml format, instead of a SOAP format. The client is configured as follows: @FeignClient(name = "calculatorServer", url = "http://www.dneonline.com/calculator.asmx") public interface AEMWebServiceFeignClient{ @PostMapping(value = "", consumes = MediaType.TEXT_XML, produces = MediaType.TEXT_XML) AddResponse calculate(@RequestBody Add addRequest)