This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 37189ba1d244 CAMEL-24844: the backlog XML dump keeps writing
<body></body> for a null body; the JSON dump's "null" type placeholder is not
copied into the type attribute
37189ba1d244 is described below
commit 37189ba1d2440434c8934f5c980ae164e4ed9ed7
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Sep 21 07:43:14 2026 +0200
CAMEL-24844: the backlog XML dump keeps writing <body></body> for a null
body; the JSON dump's "null" type placeholder is not copied into the type
attribute
Fixes BacklogDebuggerTest.testBacklogDebuggerRemoveBodyAndHeader, which
failed since 81def551326e made dumpAsJSonObject say "type": "null" for a
null body: DefaultBacklogTracerEventMessage.toXml renders from that JSON
and copied the placeholder through as type="null", where the direct XML
dumper (MessageHelper.dumpAsXml) writes no type attribute.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../apache/camel/impl/debugger/DefaultBacklogTracerEventMessage.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogTracerEventMessage.java
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogTracerEventMessage.java
index 515b6e3e517b..c4f7ce20b97e 100644
---
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogTracerEventMessage.java
+++
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogTracerEventMessage.java
@@ -519,7 +519,8 @@ public final class DefaultBacklogTracerEventMessage
implements BacklogTracerEven
sb.append(prefix);
sb.append(" <body");
String type = jo.getString("type");
- if (type != null) {
+ // the JSON dump says "null" for a null body; the XML dump has no
type attribute then
+ if (type != null && !"null".equals(type)) {
sb.append(" type=\"").append(type).append("\"");
}
Long size = jo.getLong("size");