File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
src/main/java/com/rabbitmq/client/amqp/impl Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,8 @@ public <T> T maybeRetry(Supplier<T> task) {
433
433
return RetryUtils .callAndMaybeRetry (
434
434
task ::get ,
435
435
e -> true ,
436
- BackOffDelayPolicy .fixed (Duration .ofMillis (10 )),
436
+ Duration .ofMillis (10 ),
437
+ 5 ,
437
438
"Connection affinity operation" );
438
439
}
439
440
},
Original file line number Diff line number Diff line change @@ -48,6 +48,21 @@ static <T> T callAndMaybeRetry(
48
48
args );
49
49
}
50
50
51
+ static <T > T callAndMaybeRetry (
52
+ Callable <T > operation ,
53
+ Predicate <Exception > retryCondition ,
54
+ Duration waitTime ,
55
+ int attempts ,
56
+ String format ,
57
+ Object ... args ) {
58
+ return callAndMaybeRetry (
59
+ operation ,
60
+ retryCondition ,
61
+ i -> i > attempts ? BackOffDelayPolicy .TIMEOUT : waitTime ,
62
+ format ,
63
+ args );
64
+ }
65
+
51
66
static <T > T callAndMaybeRetry (
52
67
Callable <T > operation ,
53
68
Predicate <Exception > retryCondition ,
@@ -82,7 +97,7 @@ static <T> T callAndMaybeRetry(
82
97
try {
83
98
Thread .sleep (delay .toMillis ());
84
99
} catch (InterruptedException ex ) {
85
- Thread .interrupted ();
100
+ Thread .currentThread (). interrupt ();
86
101
lastException = ex ;
87
102
keepTrying = false ;
88
103
}
You can’t perform that action at this time.
0 commit comments