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 0c855ad4d2d7 Fix NPE in CamelSendAction when timestamp is missing
(#23207)
0c855ad4d2d7 is described below
commit 0c855ad4d2d7ef0c3ed6707a152a2a18ed6f95ac
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu May 14 11:04:02 2026 +0200
Fix NPE in CamelSendAction when timestamp is missing (#23207)
* CAMEL-23514: Add metric counters to ASCII/Unicode diagram
Add metrics support to RouteDiagramAsciiRenderer matching the image
renderer: success counter on the right, failure counter on the left
of each arrow tip, with dashed arrows for zero-traffic paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Pass metrics flag to ASCII renderer in TUI monitor
Parse statistics from route-structure JSON response and pass
metrics=true to RouteDiagramAsciiRenderer so counters are shown
in the text diagram view.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Pass metrics flag to ASCII renderer in CLI route-diagram
command
The --metric flag was only passed to the image renderer. Now also
passed to RouteDiagramAsciiRenderer for ascii/unicode themes.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Add metrics toggle to TUI diagram view
Add 'm' key to toggle metrics on/off in the diagram view. When
metrics are enabled and showing a text diagram, the diagram is
automatically refreshed on each tick so counters update in real time.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Fix diagram flicker during live metric refresh
Only show the "Loading diagram..." state on initial load, not on
tick-based refreshes. Preserve scroll position when refreshing an
already-visible diagram. This prevents the visible flash between
the loading placeholder and the actual diagram content on each tick.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Fix metrics toggle not taking effect immediately
Reset diagramLoading guard before reloading so the toggle is not
blocked by an in-progress tick-triggered load that captured the
old metrics flag.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Remove refresh interval from footer
The refresh interval is not user-configurable and adds no value
to the footer display.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Add metrics to image diagram with F5 manual refresh
Pass metrics flag to RouteDiagramRenderer for image diagrams so
counters are shown. Add F5 key to manually refresh the diagram
(both text and image modes) to update counters on demand. The
image diagram shows static counters from load time since terminal
image protocols don't support partial updates. Footer hints show
F5 refresh when metrics are enabled.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Limit F5 refresh to image diagram only
Text diagram auto-refreshes on tick so F5 is redundant there.
Only show F5 hint in image diagram mode with metrics enabled.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Remove redundant r=refresh key and hint
The overview tab auto-refreshes every 100ms via tick, making the
manual r=refresh key unnecessary.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Add colored counters to text and image diagrams
Add counter position tracking to RouteDiagramAsciiRenderer so callers
can colorize success (green) and failure (red) counters.
- Renderer records CounterPos (row, col, length, type) for each counter
- renderDiagramAnsi() applies ANSI color codes for CLI terminal output
- TUI styleDiagramLine() uses positions to create colored Spans
- CLI route-diagram command uses ANSI-colored output
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Fix counter color positions after empty line removal
Counter positions from the ASCII renderer use original grid row
numbers, but empty lines are filtered out when building diagramLines.
Remap the row indices to account for removed lines so counter
coloring matches the correct positions in the TUI.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* CAMEL-23514: Fix TUI counter coloring not applied
The styleDiagramLine parser was outputting entire lines as WHITE when
no [tag] brackets were found, skipping the counter range check. Now
all text segments go through addStyledSegment which scans for counter
ranges. Also fixed findNextCounterRange to find counters starting at
or after the current position, not just those containing the position.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
* Fix NPE in CamelSendAction when timestamp is missing from JSON response
Use getLongOrDefault to avoid null unboxing when the timestamp
field is absent from the status JSON.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---------
Signed-off-by: Claus Ibsen <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
.../apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
index 7e80f9fb3081..1f507a5de05b 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSendAction.java
@@ -329,7 +329,7 @@ public class CamelSendAction extends ActionBaseCommand {
private void printStatusLine(JsonObject jo) {
// timestamp
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
- String ts = sdf.format(new Date(jo.getLong("timestamp")));
+ String ts = sdf.format(new Date(jo.getLongOrDefault("timestamp",
System.currentTimeMillis())));
if (loggingColor) {
AnsiConsole.out().print(Ansi.ansi().fgBrightDefault().a(Ansi.Attribute.INTENSITY_FAINT).a(ts).reset());
} else {