我添加了spring-retry jar和feign功能区配置。我已经停止了调用的模拟服务器,以查看它是否正在重试。我收到以下日志。我看不到任何重试内容。我正在将Hystrix与Feign一起使用。我只能看到HystrixRuntimeException。
[hystrix-find-person-1] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5417c36a: startup date [Wed Jul 11 10:47:14 BST 2018]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5115f590
[hystrix-find-person-1] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[hystrix-find-person-1] c.netflix.config.ChainedDynamicProperty : Flipping property: find-person.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
[hystrix-find-person-1] c.netflix.loadbalancer.BaseLoadBalancer : Client: find-person instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=find-person,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
[hystrix-find-person-1] c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
[hystrix-find-person-1] c.netflix.config.ChainedDynamicProperty : Flipping property: find-person.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
[hystrix-find-person-1] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client find-person initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=find-person,current list of Servers=[demo5611450.mockable.io:80],Load balancer stats=Zone stats: {unknown=[Zone:unknown; Instance count:1; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:demo5611450.mockable.io:80; Zone:UNKNOWN; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 01:00:00 GMT 1970; First connection made: Thu Jan 01 01:00:00 GMT 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
]}ServerList:com.netflix.loadbalancer.ConfigurationBasedServerList@7b506bb
[PollingServerListUpdater-0] c.netflix.config.ChainedDynamicProperty : Flipping property: find-person.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
com.netflix.hystrix.exception.HystrixRuntimeException: PersonFeignClient#postToSTF(ParticipantTraceMatchDTO) failed and no fallback available.
这是我的配置:
find-person:
ribbon:
listOfServers: demo5611450.mockable.io
MaxAutoRetries: 3
MaxAutoRetriesNextServer: 1
OkToRetryOnAllOperations: true
ServerListRefreshInterval: 2000
ConnectTimeout: 10000
ReadTimeout: 10000
hystrix.command.PFeignClient#post(Participant).execution.isolation.thread.timeoutInMilliseconds: 31000
我的另一个问题是:如何为使用伪装但不使用功能区的呼叫配置重试(因为这些呼叫是在域之外而不是微服务的呼叫)。我使用假冒网址而不是服务名称来拨打电话。