gnodet commented on PR #26845:
URL: https://github.com/apache/camel/pull/26845#issuecomment-5815837618

   @apupier Thanks for catching that! You're right that 
`softEvictConnections()` is **not** directly on `HikariDataSource` — it's on 
`HikariPoolMXBean`. The fix in commit c1aa008be631 uses a two-step reflection 
approach:
   
   1. Call `getHikariPoolMXBean()` on the `HikariDataSource` (this **is** a 
public method on `HikariDataSource`) — returns a `HikariPoolMXBean`
   2. Call `softEvictConnections()` on that MXBean
   
   This matches the standard HikariCP pattern documented in [their 
wiki](https://github.com/brettwooldridge/HikariCP/wiki/MBean-(JMX)-Monitoring-and-Management):
   ```java
   HikariPoolMXBean poolMBean = dataSource.getHikariPoolMXBean();
   poolMBean.softEvictConnections();
   ```
   
   The tests were also updated to simulate this two-step indirection accurately 
— the `HikariLikeDataSource` stub now exposes `getHikariPoolMXBean()` returning 
an object with `softEvictConnections()`, rather than putting 
`softEvictConnections()` directly on the DataSource.
   


-- 
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]

Reply via email to