Open zhouchaogithub opened 6 years ago
1、 FooConfiguration does not need to be annotated with @Configuration. However, if it is, then take care to exclude it from any @ComponentScan that would otherwise include this configuration as it will become the default source for feign.Decoder, feign.Encoder, feign.Contract, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any @ComponentScan or @SpringBootApplication, or it can be explicitly excluded in @ComponentScan. FooConfiguration不需要使用@Configuration注释。 但是,如果是,则注意将其从任何包含此配置的 @ComponentScan中排除,因为它将成为feign.Decoder,feign.Encoder,feign.Contract等的默认源。 这可以通过将它放在来自任何@ComponentScan或@SpringBootApplication的单独的非重叠包中来避 免,或者可以在@ComponentScan中明确排除。 2、The serviceId attribute is now deprecated in favor of the name attribute. 现在不推荐使用serviceId属性,而是使用name属性。 3、Previously, using the url attribute, did not require the name attribute. Using name is now required. 以前,使用url属性不需要name属性。 现在需要使用名称。
OpenFeign/feign链接 https://github.com/OpenFeign/feign
第一次访问超时报错解决方案(三种方案)
1、hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000
2、hystrix.command.default.execution.timeout.enabled: false
3、feign.hystrix.enabled: false
*/ @FeignClient("microservice-provider-user") public interface UserFeginClient { @GetMapping("/simple/{id}") //@RequestMapping(value = "/simple/{id}",method = RequestMethod.GET ) Optional findById(@PathVariable("id") Long id);
}