zhouchaogithub / spring-cloud

SpringCloud学习项目
0 stars 0 forks source link

Feign专区 #1

Open zhouchaogithub opened 6 years ago

zhouchaogithub commented 6 years ago

zhouchaogithub commented 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属性。 现在需要使用名称。

zhouchaogithub commented 6 years ago

OpenFeign/feign链接 https://github.com/OpenFeign/feign

zhouchaogithub commented 6 years ago

第一次访问超时报错解决方案(三种方案)

此方法最好,有效时间内都不能相应要么增加服务器配置、网络带宽,要不就洗洗睡吧

1、hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000

此方法不知道好坏,随便吧,我电脑配置还行,没怎么遇到超时timeout

2、hystrix.command.default.execution.timeout.enabled: false

禁用feign的hystrix(此方法不建议使用,因为hystrix断路器还有用呢,禁用了用啥???)

3、feign.hystrix.enabled: false