This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 2b3cb00ae9b9 CAMEL-24268: Remove write-only resumeInflightExchanges
field
2b3cb00ae9b9 is described below
commit 2b3cb00ae9b9fd8a6aa2ab0311775fbfbc86517c
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Jul 31 11:04:24 2026 +0200
CAMEL-24268: Remove write-only resumeInflightExchanges field
Remove dead code left behind by the ThrottlingLimits holder refactoring
in PR #24985 (CAMEL-24227): the standalone resumeInflightExchanges field
was written by setters but never read — throttle() reads from the holder
record instead. Also derive the initial holder default from the field
values instead of duplicating literals.
Closes #25207
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
.../org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
b/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
index d504c0ab9bad..e2b7b7e8c2a6 100644
---
a/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
+++
b/core/camel-support/src/main/java/org/apache/camel/throttling/ThrottlingInflightRoutePolicy.java
@@ -78,13 +78,13 @@ public class ThrottlingInflightRoutePolicy extends
RoutePolicySupport implements
@Metadata(description = "Sets at which percentage of the max the throttler
should start resuming the route.",
defaultValue = "70")
private volatile int resumePercentOfMax = 70;
- private volatile int resumeInflightExchanges = 700;
// immutable holder for throttling limits that must be visible atomically
on routing threads
private record ThrottlingLimits(int maxInflightExchanges, int
resumeInflightExchanges) {
}
- private volatile ThrottlingLimits throttlingLimits = new
ThrottlingLimits(1000, 700);
+ private volatile ThrottlingLimits throttlingLimits
+ = new ThrottlingLimits(maxInflightExchanges,
Math.max(resumePercentOfMax * maxInflightExchanges / 100, 1));
@Metadata(description = "Sets the logging level to report the throttling
activity.",
javaType = "org.apache.camel.LoggingLevel", defaultValue =
"INFO", enums = "TRACE,DEBUG,INFO,WARN,ERROR,OFF")
@@ -191,7 +191,6 @@ public class ThrottlingInflightRoutePolicy extends
RoutePolicySupport implements
this.maxInflightExchanges = maxInflightExchanges;
// recalculate, must be at least at 1
int resume = Math.max(resumePercentOfMax * maxInflightExchanges / 100,
1);
- this.resumeInflightExchanges = resume;
// atomically publish both values for routing threads
this.throttlingLimits = new ThrottlingLimits(maxInflightExchanges,
resume);
}
@@ -215,7 +214,6 @@ public class ThrottlingInflightRoutePolicy extends
RoutePolicySupport implements
this.resumePercentOfMax = resumePercentOfMax;
// recalculate, must be at least at 1
int resume = Math.max(resumePercentOfMax * maxInflightExchanges / 100,
1);
- this.resumeInflightExchanges = resume;
// atomically publish both values for routing threads
this.throttlingLimits = new ThrottlingLimits(maxInflightExchanges,
resume);
}