You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/08/30 12:38:06 UTC

(camel) 11/13: CAMEL-21144: camel-core - Backlog tracer/debugger optimize to make it faster

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch bl-xml
in repository https://gitbox.apache.org/repos/asf/camel.git

commit bce15243bcb072208d479392234bdf258ad56a36
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Aug 30 13:25:26 2024 +0200

    CAMEL-21144: camel-core - Backlog tracer/debugger optimize to make it faster
---
 .../catalog/main/camel-main-configuration-metadata.json     |  4 ++--
 .../java/org/apache/camel/impl/debugger/BacklogTracer.java  |  2 +-
 .../apache/camel/impl/debugger/DefaultBacklogDebugger.java  |  2 +-
 .../META-INF/camel-main-configuration-metadata.json         |  4 ++--
 core/camel-main/src/main/docs/main.adoc                     |  4 ++--
 .../apache/camel/main/DebuggerConfigurationProperties.java  |  4 ++--
 .../apache/camel/main/TracerConfigurationProperties.java    |  4 ++--
 .../apache/camel/management/BacklogTracerFilterTest.java    |  2 +-
 .../camel/management/BacklogTracerIdOnAllNodesTest.java     |  2 +-
 .../camel/management/BacklogTracerPatternRouteTest.java     |  2 +-
 .../apache/camel/management/BacklogTracerPatternTest.java   |  2 +-
 .../camel/management/BacklogTracerStreamCachingTest.java    |  2 +-
 .../java/org/apache/camel/management/BacklogTracerTest.java |  6 +++---
 .../main/java/org/apache/camel/support/MessageHelper.java   | 13 +++++++++++++
 docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc   |  2 +-
 docs/user-manual/modules/ROOT/pages/backlog-tracer.adoc     |  2 +-
 .../modules/ROOT/pages/camel-4x-upgrade-guide-4_8.adoc      |  4 ++--
 17 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
index a920ba1d602..df98648028e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json
@@ -142,7 +142,7 @@
     { "name": "camel.main.uuidGenerator", "description": "UUID generator to use. default (32 bytes), short (16 bytes), classic (32 bytes or longer), simple (long incrementing counter), off (turned off for exchanges - only intended for performance profiling)", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "default", "enum": [ "classic", "default", "short", "simple", "off" ] },
     { "name": "camel.debug.bodyIncludeFiles", "description": "Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.debug.bodyIncludeStreams", "description": "Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
-    { "name": "camel.debug.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 131072 },
+    { "name": "camel.debug.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 32768 },
     { "name": "camel.debug.breakpoints", "description": "Allows to pre-configure breakpoints (node ids) to use with debugger on startup. Multiple ids can be separated by comma. Use special value _all_routes_ to add a breakpoint for the first node for every route, in other words this makes it easy to debug from the beginning of every route without knowing the exact node ids.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "string", "javaType": "java.lang.S [...]
     { "name": "camel.debug.enabled", "description": "Enables Debugger in your Camel application.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
     { "name": "camel.debug.fallbackTimeout", "description": "Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used for waiting for a message to arrive at a given breakpoint.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 300 },
@@ -307,7 +307,7 @@
     { "name": "camel.trace.backlogSize", "description": "Defines how many of the last messages to keep in the tracer (should be between 1 - 1000).", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 100 },
     { "name": "camel.trace.bodyIncludeFiles", "description": "Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.trace.bodyIncludeStreams", "description": "Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
-    { "name": "camel.trace.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 131072 },
+    { "name": "camel.trace.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 32768 },
     { "name": "camel.trace.enabled", "description": "Enables tracer in your Camel application.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
     { "name": "camel.trace.includeException", "description": "Trace messages to include exception if the message failed", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.trace.includeExchangeProperties", "description": "Whether to include the exchange properties in the traced message", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/BacklogTracer.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/BacklogTracer.java
index 127aa6f3f36..1c6c82a047b 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/BacklogTracer.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/BacklogTracer.java
@@ -57,7 +57,7 @@ public final class BacklogTracer extends ServiceSupport implements org.apache.ca
     // how many of the last messages to keep in the backlog at total
     private int backlogSize = 100;
     private boolean removeOnDump = true;
-    private int bodyMaxChars = 128 * 1024;
+    private int bodyMaxChars = 32 * 1024;
     private boolean bodyIncludeStreams;
     private boolean bodyIncludeFiles = true;
     private boolean includeExchangeProperties = true;
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogDebugger.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogDebugger.java
index 71e3a2eb96b..be0c939544e 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogDebugger.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogDebugger.java
@@ -79,7 +79,7 @@ public final class DefaultBacklogDebugger extends ServiceSupport implements Back
     private boolean suspendMode;
     private String initialBreakpoints;
     private boolean singleStepIncludeStartEnd;
-    private int bodyMaxChars = 128 * 1024;
+    private int bodyMaxChars = 32 * 1024;
     private boolean bodyIncludeStreams;
     private boolean bodyIncludeFiles = true;
     private boolean includeExchangeProperties = true;
diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index a920ba1d602..df98648028e 100644
--- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -142,7 +142,7 @@
     { "name": "camel.main.uuidGenerator", "description": "UUID generator to use. default (32 bytes), short (16 bytes), classic (32 bytes or longer), simple (long incrementing counter), off (turned off for exchanges - only intended for performance profiling)", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "default", "enum": [ "classic", "default", "short", "simple", "off" ] },
     { "name": "camel.debug.bodyIncludeFiles", "description": "Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.debug.bodyIncludeStreams", "description": "Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
-    { "name": "camel.debug.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 131072 },
+    { "name": "camel.debug.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 32768 },
     { "name": "camel.debug.breakpoints", "description": "Allows to pre-configure breakpoints (node ids) to use with debugger on startup. Multiple ids can be separated by comma. Use special value _all_routes_ to add a breakpoint for the first node for every route, in other words this makes it easy to debug from the beginning of every route without knowing the exact node ids.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "string", "javaType": "java.lang.S [...]
     { "name": "camel.debug.enabled", "description": "Enables Debugger in your Camel application.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
     { "name": "camel.debug.fallbackTimeout", "description": "Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used for waiting for a message to arrive at a given breakpoint.", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties", "type": "integer", "javaType": "long", "defaultValue": 300 },
@@ -307,7 +307,7 @@
     { "name": "camel.trace.backlogSize", "description": "Defines how many of the last messages to keep in the tracer (should be between 1 - 1000).", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 100 },
     { "name": "camel.trace.bodyIncludeFiles", "description": "Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.trace.bodyIncludeStreams", "description": "Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
-    { "name": "camel.trace.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 131072 },
+    { "name": "camel.trace.bodyMaxChars", "description": "To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 32768 },
     { "name": "camel.trace.enabled", "description": "Enables tracer in your Camel application.", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" },
     { "name": "camel.trace.includeException", "description": "Trace messages to include exception if the message failed", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
     { "name": "camel.trace.includeExchangeProperties", "description": "Whether to include the exchange properties in the traced message", "sourceType": "org.apache.camel.main.TracerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true },
diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc
index 33e0f4e7e61..df6c0047c07 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -206,7 +206,7 @@ The camel.debug supports 15 options, which are listed below.
 | Name | Description | Default | Type
 | *camel.debug.bodyIncludeFiles* | Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file. | true | boolean
 | *camel.debug.bodyIncludeStreams* | Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching. | false | boolean
-| *camel.debug.bodyMaxChars* | To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. | 131072 | int
+| *camel.debug.bodyMaxChars* | To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. | 32768 | int
 | *camel.debug.breakpoints* | Allows to pre-configure breakpoints (node ids) to use with debugger on startup. Multiple ids can be separated by comma. Use special value _all_routes_ to add a breakpoint for the first node for every route, in other words this makes it easy to debug from the beginning of every route without knowing the exact node ids. |  | String
 | *camel.debug.enabled* | Enables Debugger in your Camel application. | false | boolean
 | *camel.debug.fallbackTimeout* | Fallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used for waiting for a message to arrive at a given breakpoint. | 300 | long
@@ -231,7 +231,7 @@ The camel.trace supports 14 options, which are listed below.
 | *camel.trace.backlogSize* | Defines how many of the last messages to keep in the tracer (should be between 1 - 1000). | 100 | int
 | *camel.trace.bodyIncludeFiles* | Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file. | true | boolean
 | *camel.trace.bodyIncludeStreams* | Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching. | false | boolean
-| *camel.trace.bodyMaxChars* | To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. | 131072 | int
+| *camel.trace.bodyMaxChars* | To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. | 32768 | int
 | *camel.trace.enabled* | Enables tracer in your Camel application. | false | boolean
 | *camel.trace.includeException* | Trace messages to include exception if the message failed | true | boolean
 | *camel.trace.includeExchange{zwsp}Properties* | Whether to include the exchange properties in the traced message | true | boolean
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java
index bed92227708..1655085b0e9 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/DebuggerConfigurationProperties.java
@@ -41,8 +41,8 @@ public class DebuggerConfigurationProperties implements BootstrapCloseable {
     private String breakpoints;
     @Metadata(label = "advanced")
     private boolean singleStepIncludeStartEnd;
-    @Metadata(defaultValue = "131072")
-    private int bodyMaxChars = 128 * 1024;
+    @Metadata(defaultValue = "32768")
+    private int bodyMaxChars = 32 * 1024;
     @Metadata
     private boolean bodyIncludeStreams;
     @Metadata(defaultValue = "true")
diff --git a/core/camel-main/src/main/java/org/apache/camel/main/TracerConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/TracerConfigurationProperties.java
index a1a60e91704..0bf6aa2b37b 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/TracerConfigurationProperties.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/TracerConfigurationProperties.java
@@ -36,8 +36,8 @@ public class TracerConfigurationProperties implements BootstrapCloseable {
     private int backlogSize = 100;
     @Metadata(label = "advanced", defaultValue = "true")
     private boolean removeOnDump = true;
-    @Metadata(label = "advanced", defaultValue = "131072")
-    private int bodyMaxChars = 128 * 1024;
+    @Metadata(label = "advanced", defaultValue = "32768")
+    private int bodyMaxChars = 32 * 1024;
     @Metadata
     private boolean bodyIncludeStreams;
     @Metadata(defaultValue = "true")
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
index 3a89d53ff63..4b5646138b0 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerFilterTest.java
@@ -49,7 +49,7 @@ public class BacklogTracerFilterTest extends ManagementTestSupport {
         assertEquals(Boolean.FALSE, enabled, "Should not be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         // set the filter to match only if header foo exists
         mbeanServer.setAttribute(on, new Attribute("TraceFilter", "${header.foo} != null"));
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
index 409508088cc..8d22680a27c 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerIdOnAllNodesTest.java
@@ -55,7 +55,7 @@ public class BacklogTracerIdOnAllNodesTest extends ManagementTestSupport {
         assertEquals(Boolean.FALSE, enabled, "Should not be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         // enable it
         mbeanServer.setAttribute(on, new Attribute("Enabled", Boolean.TRUE));
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
index f995ba764bb..9be1f4340da 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternRouteTest.java
@@ -47,7 +47,7 @@ public class BacklogTracerPatternRouteTest extends ManagementTestSupport {
         assertEquals(Boolean.FALSE, enabled, "Should not be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         // set the pattern to match only coolRoute
         mbeanServer.setAttribute(on, new Attribute("TracePattern", "coolRoute"));
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
index 43c1761de25..f09e6f167e9 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerPatternTest.java
@@ -48,7 +48,7 @@ public class BacklogTracerPatternTest extends ManagementTestSupport {
         assertEquals(Boolean.FALSE, enabled, "Should not be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         // set the pattern to match only foo*
         mbeanServer.setAttribute(on, new Attribute("TracePattern", "foo*"));
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerStreamCachingTest.java b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerStreamCachingTest.java
index e1e7de5f020..a7a8a30d657 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerStreamCachingTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerStreamCachingTest.java
@@ -50,7 +50,7 @@ public class BacklogTracerStreamCachingTest extends ManagementTestSupport {
         assertEquals(Boolean.FALSE, enabled, "Should not be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         Boolean removeOnDump = (Boolean) mbeanServer.getAttribute(on, "RemoveOnDump");
         assertEquals(Boolean.TRUE, removeOnDump);
diff --git a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerTest.java b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerTest.java
index aeff7ddc493..2dc282ae00b 100644
--- a/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerTest.java
+++ b/core/camel-management/src/test/java/org/apache/camel/management/BacklogTracerTest.java
@@ -53,7 +53,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
         assertEquals(Boolean.TRUE, enabled, "Should be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         Boolean removeOnDump = (Boolean) mbeanServer.getAttribute(on, "RemoveOnDump");
         assertEquals(Boolean.TRUE, removeOnDump);
@@ -109,7 +109,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
         assertEquals(Boolean.TRUE, enabled, "Should be enabled");
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
 
         getMockEndpoint("mock:foo").expectedMessageCount(2);
         getMockEndpoint("mock:bar").expectedMessageCount(2);
@@ -397,7 +397,7 @@ public class BacklogTracerTest extends ManagementTestSupport {
         mbeanServer.setAttribute(on, new Attribute("RemoveOnDump", Boolean.FALSE));
 
         Integer size = (Integer) mbeanServer.getAttribute(on, "BacklogSize");
-        assertEquals(1000, size.intValue(), "Should be 1000");
+        assertEquals(100, size.intValue(), "Should be 100");
         // change size to 2 x 10 (as we need for first as well)
         mbeanServer.setAttribute(on, new Attribute("BacklogSize", 20));
         // set the pattern to match only foo
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
index 4f95f4b408b..3aca2ab6827 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
@@ -1081,11 +1081,24 @@ public final class MessageHelper {
                 int size = Array.getLength(body);
                 jb.put("size", size);
             }
+            if (body instanceof WrappedFile<?> wf) {
+                if (wf.getFile() instanceof File f) {
+                    jb.put("size", f.length());
+                }
+            } else if (body instanceof File f) {
+                jb.put("size", f.length());
+            } else if (body instanceof Path p) {
+                jb.put("size", p.toFile().length());
+            }
             if (body instanceof StreamCache streamCache) {
                 long pos = streamCache.position();
                 if (pos != -1) {
                     jb.put("position", pos);
                 }
+                long size = streamCache.length();
+                if (size > 0) {
+                    jo.put("size", size);
+                }
             }
             String data = extractBodyForLogging(message, null, allowCachedStreams, allowStreams, allowFiles, maxChars);
             if (data != null) {
diff --git a/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc b/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc
index 31ba85778b7..349c189ab9e 100644
--- a/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc
+++ b/docs/user-manual/modules/ROOT/pages/backlog-debugger.adoc
@@ -21,7 +21,7 @@ NOTE: This requires to enabled JMX by including `camel-management` JAR in the cl
 |Option |Default |Description
 |`bodyIncludeFiles` |`true` |Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file.
 |`bodyIncludeStreams` |`false` |Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching.
-|`bodyMaxChars` |`128kb` |To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.
+|`bodyMaxChars` |`32kb` |To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.
 |`includeExchangeProperties` |`true`|Whether to include the exchange properties in the traced message.
 |`includeExchangeVariables` |`true`|Whether to include the exchange variables in the traced message.
 |`standby` | `false` |Whether the debugger is standby. If a debugger is in standby then the debugger is activated during startup and are ready to be enabled manually via JMX or calling the enableDebugger method.
diff --git a/docs/user-manual/modules/ROOT/pages/backlog-tracer.adoc b/docs/user-manual/modules/ROOT/pages/backlog-tracer.adoc
index eb585b30d59..b1877850a68 100644
--- a/docs/user-manual/modules/ROOT/pages/backlog-tracer.adoc
+++ b/docs/user-manual/modules/ROOT/pages/backlog-tracer.adoc
@@ -56,7 +56,7 @@ Turning this on increases the verbosity of tracing by including events from inte
 |removeOnDump |`true` |Whether to remove the traced messages that was returned when invoking
 the dump methods.
 
-|bodyMaxChars |`128kb` |To limit the message body to a maximum size in the traced message. Use 0
+|bodyMaxChars |`32kb` |To limit the message body to a maximum size in the traced message. Use 0
 or negative value to use unlimited size.
 
 |bodyIncludeStreams |`false` |Whether to include the message body of stream based messages. If enabled
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_8.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_8.adoc
index 5536e087fcc..24fbc24157e 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_8.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_8.adoc
@@ -22,8 +22,8 @@ Internally, Camel will now use Java's own `InputStream.transferTo` for copying d
 require customized buffer sizes or data flushing policies. Additionally, the size of the data buffer used by Camel when
 performing these copies has increased from 4096 bytes to 16384 bytes (the default buffer size used by Java 21).
 
-The tracer (`BacklogTracer`) has changed the `backlogSize` default value from `1000` to `100`. This reduces the amount of
-data captured and stored and helps reduce the tracing overhead.
+The tracer (`BacklogTracer`) has changed the `backlogSize` default value from `1000` to `100`, and `maxBodySize` from `128kb` to `32kb`.
+This reduces the amount of data captured and stored and helps reduce the tracing overhead.
 
 === Deprecated Components