困扰两天了,没搞清楚究竟是干嘛了
@FeignClient(value = "datameta", url = "http://xxxx/")
public interface RemoveDataSourceCaller {
/**
* 获取集群组件信息
*
* @return
*/
@RequestMapping(value = "/xxxxx", method = RequestMethod.POST, produces = {
"application/json;charset=UTF-8"
})
ResponseU getxxxxx();
}
然后我在一个接口调用
ResponseU clusterListInfo = removeDataSourceCaller.getxxxxx();
每次debug返回的clusterListInfo都是null,有人遇到过吗,原因我想不出来究竟是什么,百度有人说要加注解,但注解是有的,我这里又没参数,没看明白
自己试了2小时,我也是刚在学习springcloud, 我发现没打断点的情况下是正常返回, 打了断点没走完,过了一会就马上响应了,最后发现是启用了熔断器的熔断超时响应了,默认是1秒, 配置上熔断器超时和调用超时就好了:
hystrix:
command:
ribbon:
ConnectTimeout: 5000
ReadTimeout: 50000