From 0c7335d79af29bb63107505175071da837e5b7ed Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Sun, 12 Jul 2026 10:19:36 +0200 Subject: [PATCH] CAMEL-24003: Add activityEnabled and activitySize options to Spring Boot tracer Co-Authored-By: Claude Opus 4.6 Signed-off-by: Claus Ibsen --- .../src/main/docs/spring-boot.json | 14 ++++++++++ .../trace/CamelTraceAutoConfiguration.java | 5 ++++ .../CamelTraceConfigurationProperties.java | 28 +++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json b/core/camel-spring-boot/src/main/docs/spring-boot.json index 85836fd4ea6b..e2b2c113a46f 100644 --- a/core/camel-spring-boot/src/main/docs/spring-boot.json +++ b/core/camel-spring-boot/src/main/docs/spring-boot.json @@ -1585,6 +1585,20 @@ "description": "Sets the default time unit used for keep alive time", "sourceType": "org.apache.camel.spring.boot.threadpool.CamelThreadPoolConfigurationProperties" }, + { + "name": "camel.trace.activity-enabled", + "type": "java.lang.Boolean", + "description": "Whether activity tracking is enabled.", + "sourceType": "org.apache.camel.spring.boot.trace.CamelTraceConfigurationProperties", + "defaultValue": false + }, + { + "name": "camel.trace.activity-size", + "type": "java.lang.Integer", + "description": "Number of completed exchange summaries to keep in the activity queue (should be between 1 - 1000). Default is 100.", + "sourceType": "org.apache.camel.spring.boot.trace.CamelTraceConfigurationProperties", + "defaultValue": 100 + }, { "name": "camel.trace.backlog-size", "type": "java.lang.Integer", diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceAutoConfiguration.java index c3f3c1ac6c90..b4ebfa3acf00 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceAutoConfiguration.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceAutoConfiguration.java @@ -63,6 +63,11 @@ public BacklogTracer backlogTracer(CamelContext camelContext, CamelTraceConfigur tracer.setTraceTemplates(config.isTraceTemplates()); tracer.setTracePattern(config.getTracePattern()); tracer.setTraceFilter(config.getTraceFilter()); + tracer.setActivitySize(config.getActivitySize()); + // dev profile enables activity tracking so tooling (TUI) gets enriched data + boolean activityEnabled = config.isActivityEnabled() + || "dev".equals(camelContext.getCamelContextExtension().getProfile()); + tracer.setActivityEnabled(activityEnabled); camelContext.getCamelContextExtension().addContextPlugin(BacklogTracer.class, tracer); camelContext.addService(tracer); diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceConfigurationProperties.java index 32574b4305eb..48fcd93dcbd5 100644 --- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceConfigurationProperties.java +++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/trace/CamelTraceConfigurationProperties.java @@ -93,6 +93,18 @@ public class CamelTraceConfigurationProperties { @Metadata(label = "advanced") private boolean traceTemplates; + /** + * Whether activity tracking is enabled. + */ + private boolean activityEnabled; + + /** + * Number of completed exchange summaries to keep in the activity queue (should be between 1 - 1000). Default is + * 100. + */ + @Metadata(label = "advanced", defaultValue = "100") + private int activitySize = 100; + /** * Filter for tracing by route or node id */ @@ -199,6 +211,22 @@ public void setTraceTemplates(boolean traceTemplates) { this.traceTemplates = traceTemplates; } + public boolean isActivityEnabled() { + return activityEnabled; + } + + public void setActivityEnabled(boolean activityEnabled) { + this.activityEnabled = activityEnabled; + } + + public int getActivitySize() { + return activitySize; + } + + public void setActivitySize(int activitySize) { + this.activitySize = activitySize; + } + public String getTracePattern() { return tracePattern; }