From d1b50af2bc86064177ed8784f3bfb27cbd9e1172 Mon Sep 17 00:00:00 2001 From: hexiaofeng Date: Wed, 8 May 2024 16:56:14 +0800 Subject: [PATCH] review retry --- .../agent/governance/interceptor/AbstractInterceptor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/interceptor/AbstractInterceptor.java b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/interceptor/AbstractInterceptor.java index d0cf3a13..4aea0578 100644 --- a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/interceptor/AbstractInterceptor.java +++ b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/interceptor/AbstractInterceptor.java @@ -18,6 +18,7 @@ import com.jd.live.agent.bootstrap.bytekit.context.MethodContext; import com.jd.live.agent.core.plugin.definition.InterceptorAdaptor; import com.jd.live.agent.governance.context.RequestContext; +import com.jd.live.agent.governance.context.bag.Carrier; import com.jd.live.agent.governance.instance.Endpoint; import com.jd.live.agent.governance.invoke.InboundInvocation; import com.jd.live.agent.governance.invoke.InboundInvocation.GatewayInboundInvocation; @@ -39,8 +40,6 @@ import java.util.List; import java.util.function.Supplier; -import static com.jd.live.agent.governance.invoke.retry.Retrier.DEADLINE_KEY; - /** * AbstractInterceptor is the base class for all interceptors within the framework. * It provides a common context for the interception process and defines the structure @@ -218,7 +217,7 @@ protected Object invokeWithRetry(O invocation, MethodContext ctx) { if (retrier != null) { Long timeout = retryPolicy.getTimeout(); if (timeout != null && timeout > 0) { - RequestContext.getOrCreate().setAttribute(DEADLINE_KEY, System.currentTimeMillis() + timeout); + RequestContext.getOrCreate().setAttribute(Carrier.ATTRIBUTE_DEADLINE, System.currentTimeMillis() + timeout); } return retrier.execute(retrySupplier); }