Raymond created CAMEL-22378:
-------------------------------
Summary: Installation report
Key: CAMEL-22378
URL: https://issues.apache.org/jira/browse/CAMEL-22378
Project: Camel
Issue Type: Wish
Components: came-core
Affects Versions: 4.14.0
Reporter: Raymond
This ticket is basically a wish/idea to better information after installation
of routes or a route group.
The routeController actions, such as start/stop/suspend/resume currently are
void and don't return the status/result of the action. Sometimes however one
would like to have more information.
There is the
{{[hasUnhealthyRoutes|https://www.javadoc.io/static/org.apache.camel/camel-api/4.14.0/org/apache/camel/spi/RouteController.html#hasUnhealthyRoutes()]()}}
method and {{getRouteStatus(routeId). But hasUnhealthyRoutes only return a
boolean, while the getRouteStatus }}returns a {{ServiceStatus}} enum
({{{}Started{}}}, {{{}Starting{}}}, {{{}Stopped{}}}, {{{}Failed{}}}, etc.).
Of course there are indirect ways to get more information such as EventNotifier
or RoutePolicy, but I think the routeController could provide an easier access
to such information.
I would like to have a report with information like:
1. Route ID
2. Group
3. From uri
4. Time (Either a unix timestamp or an ISO 8601 date)
5. ServiceStatus
6. Unhealhy (true/false)
7. Error message
A method such as "getInstallationReport("routeId")" could return:
{
"routeId": "123",
"group": "order",
"time": "2025-08-27T09:04:32.456",
"fromUri": "sql:somesql",
"unhealthy": true,
"status": "failed",
"error": "Database error"
}
For a group or all routes it can be put in a JSONArray. For example
getInstallationReportByGroup("myGroup")
[{
"routeId": "123",
"group": "order",
"time": "2025-08-27T09:04:32.456",
"fromUri": "sql:somesql",
"unhealthy": true,
"status": "failed",
"error": "Database error"
},
{
"routeId": "456",
"group": "order",
"time": "2025-08-27T09:04:34.362",
"fromUri": "direct:validate",
"unhealthy": false,
"status": "started",
"error": ""
}]
This can be either per route or route group. To give an idea, here is an
example installation report that is returned by Assimbly (a flow in this case
is group, while step a route):
{code:java}
{"flow": {
"stepsLoaded": {
"total": 5,
"successfully": 5,
"failed": 0
},
"name": "686e726ecd40200007000004",
"id": "686e726ecd40200007000004",
"time": "1535 milliseconds",
"event": "start",
"message": "Started flow successfully",
"version": "",
"steps": [
{
"id": "0",
"type": "error",
"uri": "",
"status": "success"
},
{
"id": "94bd94b8efa7",
"type": "routeTemplate",
"uri": "texttobase64",
"status": "success"
},
{
"id": "886fd5a7817d",
"type": "routeTemplate",
"uri": "setbody?language=simple&expression=1234",
"status": "success"
},
{
"id": "706c927a3480",
"type": "routeTemplate",
"uri": "log?showBody=true&showException=false&showHeaders=false",
"status": "success"
},
{
"id": "22fe3e66c3cc",
"type": "routeTemplate",
"uri": "https://0.0.0.0:9001/test/inbound_http/_new/textToBase64",
"status": "success"
}
]
}} {code}
I guess such a report would be handy whether you start route or route group
through the routecontroller, routeloader or context.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)