davsclaus commented on code in PR #26939:
URL: https://github.com/apache/camel/pull/26939#discussion_r4129542025


##########
core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogDebugger.java:
##########
@@ -239,7 +239,17 @@ public boolean hasBreakpoint(String nodeId) {
 
     @Override
     public void setSuspendMode(boolean suspendMode) {
+        boolean changed = this.suspendMode != suspendMode;
         this.suspendMode = suspendMode;
+        if (changed) {
+            if (suspendMode) {
+                // wait for a debugger to attach (as when suspend mode is set 
from the environment)
+                detach();
+            } else {
+                // do not keep messages waiting for a debugger that is no 
longer expected
+                resumeMessageProcessing();

Review Comment:
   Agreed on both. Fixed in b1dcc27cd58d: the configurer now only calls 
`setSuspendMode(true)` when `waitForAttach` is `true`, so the suspend mode from 
`CAMEL_DEBUGGER_SUSPEND` / `-Dorg.apache.camel.debugger.suspend=true` is kept. 
Added an upgrade guide entry saying `camel.debug.waitForAttach=true` now 
suspends processing until a debugger attaches.
   
   _Claude Code on behalf of davsclaus_



##########
core/camel-base-engine/src/main/java/org/apache/camel/impl/debugger/DefaultBacklogTracerEventMessage.java:
##########
@@ -372,34 +372,36 @@ public String toXml(int indent) {
         sb.append(prefix).append("  
<done>").append(isDone()).append("</done>\n");
         sb.append(prefix).append("  
<failed>").append(isFailed()).append("</failed>\n");
         if (getLocation() != null) {
-            sb.append(prefix).append("  
<location>").append(getLocation()).append("</location>\n");
+            sb.append(prefix).append("  
<location>").append(StringHelper.xmlEncode(getLocation())).append("</location>\n");
         }
         // route id is optional and we then use an empty value for no route id
         sb.append(prefix).append("  <routeId>").append(routeId != null ? 
routeId : "").append("</routeId>\n");

Review Comment:
   Fixed in b1dcc27cd58d: `routeId`, `fromRouteId` and the `<toNode>` fallback 
are now XML encoded. `testDumpAsXmlIsWellFormed` now also traces a route with 
id `a&b` and parses the dump.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to