一、该问题的重现步骤是什么?
实现了一个业务的缓存类,业务逻辑是先通过编码去取到外部接口的数据,然后再根据取到的数据在本地获取对应的匹配,最终将其进行VO组合返回前端。
Cache代码
public static Long getTaxAuthorityId(String code) {
Long result = CacheUtil.get(CacheNames.TAXAUTHORITY_CACHENAME, CacheNames.TAXAUTHORITY_CODE_KEYPREFIX, code, Long.class, TENANT_MODE);
if (null == result) {
R<Long> response = getInstance().getTaxAuthorityId(code);
if (response.isSuccess()) {
result = response.getData();
CacheUtil.put(CacheNames.TAXAUTHORITY_CACHENAME, CacheNames.TAXAUTHORITY_CODE_KEYPREFIX, code, result, TENANT_MODE);
}
}
return result;
}
客户端接口
@FeignClient(
value = CommonConstant.APPLICATION_BUSINESS_NAME,
fallback = TaxAuthorityFallback.class
)
public interface ITaxAuthorityClient {
String API_PREFIX = "/clinet";
String GET_EXCHEQUERNAME = API_PREFIX + "/taxauthority/get-exchequername";
String GET_TAXAUTHORITYID = API_PREFIX + "/taxauthority/get-taxauthorityid";
@GetMapping(GET_TAXAUTHORITYID)
R<Long> getTaxAuthorityId(String code);
}
客户端接口实现,方法一直不进这里,直接就返回了fallback
@Override
@GetMapping(GET_TAXAUTHORITYID)
public R<Long> getTaxAuthorityId(String code) {
Wrapper<TaxAuthority> wrapper = new QueryWrapper<TaxAuthority>().lambda()
.eq(TaxAuthority::getTaxCode, code)
.select(TaxAuthority::getId);
TaxAuthority taxAuthority = taxAuthorityService.getOne(wrapper);
return R.data(taxAuthority.getId());
}
二、你期待的结果是什么?实际看到的又是什么?
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
2.8.1
四、请提供详细的错误堆栈信息,这很重要。
2021-06-10 10:47:47.457 INFO 20800 --- [ XNIO-1 task-1] org.springblade.core.http.Slf4jLogger : --> GET http://url
2021-06-10 10:47:47.606 INFO 20800 --- [ XNIO-1 task-1] org.springblade.core.http.Slf4jLogger : <-- 200 OK url (148ms, unknown-length body)
2021-06-10 10:47:47.874 WARN 20800 --- [ XNIO-1 task-1] o.s.c.openfeign.FeignClientFactoryBean : The provided URL is empty. Will try picking an instance via load-balancing.
2021-06-10 10:47:48.213 INFO 20800 --- [ XNIO-1 task-1] c.netflix.loadbalancer.BaseLoadBalancer : Client: blade-business instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=blade-business,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
2021-06-10 10:47:48.220 INFO 20800 --- [ XNIO-1 task-1] c.n.l.DynamicServerListLoadBalancer : Using serverListUpdater PollingServerListUpdater
2021-06-10 10:47:48.247 INFO 20800 --- [ XNIO-1 task-1] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client blade-business initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=blade-business,current list of Servers=[192.168.1.2:8109],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:192.168.1.2:8109; Zone:UNKNOWN; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 08:00:00 CST 1970; First connection made: Thu Jan 01 08:00:00 CST 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.alibaba.cloud.nacos.ribbon.NacosServerList@5ba811d3
2021-06-10 10:57:22.706 ERROR 20800 --- [ient-executor-4] com.alibaba.nacos.common.remote.client : [1623293033863_ip_52111]Request stream onCompleted, switch server
2021-06-10 10:57:22.706 ERROR 20800 --- [ient-executor-2] com.alibaba.nacos.common.remote.client : [1623293014350_ip_52087]Request stream onCompleted, switch server
2021-06-10 10:57:22.743 ERROR 20800 --- [aming.updater.0] com.alibaba.nacos.common.remote.client : Send request fail, request=ServiceQueryRequest{headers={}, requestId='null'}, retryTimes=0,errorMessage=java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: HTTP/2 error code: NO_ERROR
Received Goaway
app_requested
五、若有更多详细信息,请在下面提供。
扫一扫访问 Blade技术社区 移动端