Bruno Gonçalves created CAMEL-23615:
---------------------------------------

             Summary: Add getLastExchangeFailureHandledTimestamp() to 
ManagedRouteGroupMBean and ManagedRouteMBean
                 Key: CAMEL-23615
                 URL: https://issues.apache.org/jira/browse/CAMEL-23615
             Project: Camel
          Issue Type: New Feature
          Components: camel-management
    Affects Versions: 4.20.0
            Reporter: Bruno Gonçalves


{*}{{{{Background
}}}}{*}{{{}{{ManagedRouteMBean}}{}}} and {{{{ManagedRouteGroupMBean}}}} 
currently expose the following timestamp methods:
 * {{getLastExchangeCompletedTimestamp()}} — timestamp of the last completed 
exchange
 * {{getLastExchangeFailureTimestamp()}} — timestamp of the last failed 
(unhandled) exchange

However, there is no timestamp method for *handled failures* — exchanges that 
failed but were routed to a dead letter endpoint or handled by an 
{{onException}} clause. These are counted under {{getFailuresHandled()}} but 
there is no corresponding timestamp.



*Problem*
>From a monitoring and observability perspective, operators need to know *when* 
>the last handled failure occurred — not just how many there were. The count 
>({{{}getFailuresHandled(){}}}) is available but incomplete without a timestamp.

When using a {{{}DeadLetterChannel{}}}, all failures are counted as 
{{failuresHandled}} and {{lastExchangeFailureTimestamp}} is always {{null}} — 
making it impossible to determine when the last failure happened through the 
management API.


*Proposed Solution*
Add a new method to {{{}ManagedPerformanceCounterMBean{}}}, 
{{ManagedRouteMBean}} and {{{}ManagedRouteGroupMBean{}}}:
{code:java}
Date getLastExchangeFailureHandledTimestamp();{code}
This should be set in ManagedPerformanceCounter alongside the failuresHandled 
counter increment — the same way lastExchangeFailureTimestamp is set alongside 
exchangesFailed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to