From 71930fd9f09e6a8e8ca3b5bf3089ae8f0829a694 Mon Sep 17 00:00:00 2001 From: Olga MaciaszekSharma Date: Mon, 26 Jul 2021 17:03:33 +0200 Subject: [PATCH] Do not reset RequestAttributes. Fixes gh-572. --- .../openfeign/FeignCircuitBreakerInvocationHandler.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignCircuitBreakerInvocationHandler.java b/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignCircuitBreakerInvocationHandler.java index 3cf62021..b31374a7 100644 --- a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignCircuitBreakerInvocationHandler.java +++ b/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignCircuitBreakerInvocationHandler.java @@ -106,7 +106,7 @@ class FeignCircuitBreakerInvocationHandler implements InvocationHandler { return () -> { try { RequestContextHolder.setRequestAttributes(requestAttributes); - return this.dispatch.get(method).invoke(args); + return dispatch.get(method).invoke(args); } catch (RuntimeException throwable) { throw throwable; @@ -114,9 +114,6 @@ class FeignCircuitBreakerInvocationHandler implements InvocationHandler { catch (Throwable throwable) { throw new RuntimeException(throwable); } - finally { - RequestContextHolder.resetRequestAttributes(); - } }; }