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 2023/08/18 11:19:32 UTC
[camel] branch camel-3.x updated: CAMEL-19744: camel-core - Backlog tracer capturing data as json when its not json
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push:
new c3b1ca24f3f CAMEL-19744: camel-core - Backlog tracer capturing data as json when its not json
c3b1ca24f3f is described below
commit c3b1ca24f3f0bba5eb438df6561ef3614fb26585
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Aug 18 13:19:21 2023 +0200
CAMEL-19744: camel-core - Backlog tracer capturing data as json when its not json
---
.../src/test/java/org/apache/camel/util/MessageHelperTest.java | 4 ++--
.../src/main/java/org/apache/camel/support/MessageHelper.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java
index d8f1662c63a..c2c15296405 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/MessageHelperTest.java
@@ -271,8 +271,8 @@ public class MessageHelperTest {
message.setHeader("foo", 123);
String out = MessageHelper.dumpAsJSon(message);
- // xml is escaped in json output
- assertTrue(out.contains("<?xml version=\\\"1.0\\\"?><hi>Hello World<\\/hi>"));
+ // xml is escaped in json output (a lot of escape)
+ assertTrue(out.contains("<?xml version=\\\\\\\"1.0\\\\\\\"?><hi>Hello World<\\\\\\/hi>"));
assertTrue(out.contains(message.getExchange().getExchangeId()), "Should contain exchangeId");
context.stop();
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 fb490910c60..fc119be3437 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
@@ -869,7 +869,7 @@ public final class MessageHelper {
String data = extractBodyForLogging(message, null, allowCachedStreams, allowStreams, allowFiles, maxChars);
if (data != null) {
- jb.put("value", Jsoner.unescape(data));
+ jb.put("value", Jsoner.escape(data));
}
}