davsclaus opened a new pull request, #23301: URL: https://github.com/apache/camel/pull/23301
## Summary _Claude Code on behalf of Claus Ibsen_ This PR contains a batch of TUI improvements and related core fixes accumulated on the `feat/camel-tui` branch. ### Core fixes - **`DefaultPlatformHttpConsumer`**: Override `setRouteId()` to propagate the route ID to the inner `PlatformHttpConsumer`. Previously, `doInit()` created the nested consumer before `RouteService` called `setRouteId()`, so exchanges carried a null `fromRouteId` and endpoint statistics showed 0 hits (CAMEL-23544). - **`DefaultRuntimeEndpointRegistry`**: Track the consumer endpoint URI in the `inputs` map so platform-http and other delegating consumers correctly report exchange statistics in the Endpoints tab. - **`BacklogTracer`**: Set `first=true` on `traceBeforeNode` and `last=true` on `traceAfterNode` events to form correct first/last pairs. Populate `endpointUri` on synthetic events via route lookup. - **`SyntheticBacklogTracer`** (new SPI): Allows components that bypass the route pipeline (e.g. rest-openapi mock mode) to emit properly-paired trace events visible in the TUI Inspect tab. - **`RestDevConsole`**: Fixed a timing bug where rest-openapi contract-first routes were not visible — the console now uses lazy `RestRegistry` lookup on every call instead of caching at `doInit()`. - **`RestRegistry` / `RestService`**: Added `getOperationId()` and `getSpecificationUri()` to the `RestService` interface. Updated `addRestService()` signature accordingly. `RestOpenApiProcessor` now populates both fields from the OpenAPI contract. ### New: `RestSpecDevConsole` New `rest-spec` dev console that loads and returns the full content of OpenAPI specification files registered in `RestRegistry`. Supports a `filter` option for pattern-matching on `specificationUri`. Produces both TEXT and JSON output. Content is loaded via `PluginHelper.getResourceLoader().resolveResource()` so `classpath:`, `file:`, and `http:` URIs all work. ### TUI improvements - **Tab layout**: badge counters moved above labels; spacer row between tabs and content; all tab names made singular (Route, Consumer, Endpoint, HTTP, Health, Inspect, Circuit Breaker). - **HTTP tab** (new, position 6): unified view of REST DSL + Platform-HTTP services with METHOD / PATH / CONSUMES / PRODUCES / SOURCE / STATE columns. Supports sort (s/S), filter between all/rest/http (f), and management endpoint toggle (m). Detail panel shows URL, consumes, produces, source, route ID, operation ID, spec URI, state, in/out types, and description. - **OpenAPI spec viewer**: press `c` on a contract-first endpoint in the HTTP tab to fetch and display the full OpenAPI spec. Auto-scrolls to the HTTP verb declaration (`get:` / `post:` / etc.) for the selected `operationId` by walking backwards from the `operationId` line to the enclosing verb at a shallower indentation level. Supports `↑↓`, `PgUp/PgDn`, `Home/End` navigation; close with `c` or `Esc`. - **Endpoints tab**: fixed bidirectional endpoints missing one direction's statistics; added 3-state remote filter (all / remote / remote+stub). - **Inspect tab**: merged the old Last and Trace tabs into a single Inspect tab. - rest-openapi mock mode now emits `BacklogTracer` events visible in the Inspect tab. ## Test plan - [ ] Start a Camel application with REST DSL (code-first) routes and verify the HTTP tab lists all endpoints with correct statistics - [ ] Start a Camel application with a rest-openapi contract-first route (e.g. Petstore), verify the HTTP tab shows all operations with `operationId` and spec URI in the detail panel - [ ] Press `c` on a contract-first endpoint — spec viewer should open, scrolled to the HTTP verb declaration for that operation - [ ] Verify `↑↓`, `PgUp/PgDn`, `Home/End` scroll the spec viewer; `c`/`Esc` closes it - [ ] Verify the Endpoints tab shows correct IN/OUT statistics for platform-http endpoints - [ ] Verify BacklogTracer events from rest-openapi mock mode appear in the Inspect tab 🤖 Generated with [Claude Code](https://claude.ai/claude-code) on behalf of Claus Ibsen -- 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]
