[ 
https://issues.apache.org/jira/browse/CAMEL-24215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-24215:
--------------------------------
    Issue Type: Task  (was: Bug)

> camel-resilience4j - JMX waitDurationInOpenState still reports seconds while 
> the option is now millis
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24215
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24215
>             Project: Camel
>          Issue Type: Task
>          Components: eip
>    Affects Versions: 4.22.0
>            Reporter: Andrea Cosentino
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 4.22.0
>
>
> Follow-up from CAMEL-24137 (Circuit Breaker EIP modernization, phase 1), 
> merged as {{c5b1068faae3}}.
> That change converted {{waitDurationInOpenState}} from seconds to 
> milliseconds, but the matching JMX managed attribute still reports *seconds*:
> {{components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessor.java}}
>  lines 447-448:
> {noformat}
> public long getCircuitBreakerWaitDurationInOpenState() {
>     return 
> Duration.ofMillis(circuitBreakerConfig.getWaitIntervalFunctionInOpenState().apply(1)).getSeconds();
> }
> {noformat}
> Every sibling attribute in the same class returns milliseconds:
> * {{getBulkheadMaxWaitDuration()}} (lines 476-478) -> {{.toMillis()}}
> * {{getTimeoutDuration()}} (lines 490-492) -> {{.toMillis()}}
> So after the change, configuring {{waitDurationInOpenState("1500")}} (1.5 
> seconds) makes JMX report {{1}}, because {{getSeconds()}} truncates. The 
> option and the JMX view of that same option now disagree on units — which is 
> precisely the seconds/millis inconsistency CAMEL-24137 set out to remove.
> h3. Suggested fix
> Change {{getSeconds()}} to {{toMillis()}} so the attribute matches both its 
> siblings and the option it reports.
> Note this is an observable JMX contract change (the attribute value changes 
> for existing users), so it warrants a line in 
> {{docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc}} 
> alongside the existing camel-resilience4j duration entry.



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

Reply via email to