[
https://issues.apache.org/jira/browse/CAMEL-23050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18061190#comment-18061190
]
Claus Ibsen commented on CAMEL-23050:
-------------------------------------
This is not the same
LastError is not because of exchange routing failures. Its due to route cannot
startup or some other issues, can also be health-check that is detected an
exception and causing the route to be in error.
It can also be if you attempt to start or stop the route via management API and
then that fails for some reason.
Failures of exchanges during routing is not kept in the mbeans. This could leak
user data, as the failure could for example happened 3 months ago, and then
some object contains a stacktrace and some user data.
If you want to collect failures during routing then that requires some other
concept as you allude to via the DSL. But Camel has a big complex DSL already
so that is not going to be added more.
If you want custom error registry and to query that then you can build your
own. For example from the message history, then you can capture everything that
happens to a message during routing, and you can then store that in some
history storage.
> Add getLastHandledError to ManagedRouteMBean and ManagedRouteGroupMBean API
> ---------------------------------------------------------------------------
>
> Key: CAMEL-23050
> URL: https://issues.apache.org/jira/browse/CAMEL-23050
> Project: Camel
> Issue Type: Improvement
> Reporter: Raymond
> Priority: Minor
>
> This issue is related to this issue:
> https://issues.apache.org/jira/browse/CAMEL-23049
> Currently, you only get the unhandled last error. I would like to get the
> last *handled* error (on route and group level) instead.
> *Note:* An additional thought, would it be practical if there is a general
> "Error Registry" or "Error Factory" that automatically stores and indexes
> failed exchanges for later querying?
> I can then have some fluent API (like a FluentProducer) to query. Examples
> (pseudo-code):
> {code:java}
> //get last 10 failures that are handled of route 123
> errorRegistry
> .last(10)
> .handled(true)
> .routeId("123")
> //get last 3 failures that are unhandled of endpoint ftp:myServer
> errorRegistry
> .last(3)
> .handled(false)
> .endpoint("ftp:myServer")
> //get last unhandled failure of group OrderIntegration
> errorRegistry
> .group("orderIntegration") {code}
> This then could give back a map with RouteID and RouteError object.
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)