소스 검색

Resolves #61: Enhance exception trace in Sentinel Dubbo Adapter

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 6 년 전
부모
커밋
49097fa45c
2개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. +7
    -1
      sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java
  2. +5
    -1
      sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java

+ 7
- 1
sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java 파일 보기

@@ -57,7 +57,13 @@ public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements
ContextUtil.enter(resourceName);
interfaceEntry = SphU.entry(invoker.getInterface().getName(), EntryType.OUT);
methodEntry = SphU.entry(resourceName, EntryType.OUT);
return invoker.invoke(invocation);

Result result = invoker.invoke(invocation);
if (result.hasException()) {
// Record common exception.
Tracer.trace(result.getException());
}
return result;
} catch (BlockException e) {
return DubboFallbackRegistry.getConsumerFallback().handle(invoker, invocation, e);
} catch (RpcException e) {


+ 5
- 1
sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java 파일 보기

@@ -63,7 +63,11 @@ public class SentinelDubboProviderFilter extends AbstractDubboFilter implements
interfaceEntry = SphU.entry(interfaceName, EntryType.IN);
methodEntry = SphU.entry(resourceName, EntryType.IN, 1, invocation.getArguments());

return invoker.invoke(invocation);
Result result = invoker.invoke(invocation);
if (result.hasException()) {
Tracer.trace(result.getException());
}
return result;
} catch (BlockException e) {
return DubboFallbackRegistry.getProviderFallback().handle(invoker, invocation, e);
} catch (RpcException e) {


Loading…
취소
저장