gnodet commented on PR #26845:
URL: https://github.com/apache/camel/pull/26845#issuecomment-5815947452
@apupier — addressed in c1aa008be631090a1f676470aa474fb6489ff319.
You're right that `softEvictConnections()` is not a method on
`HikariDataSource` itself — it's declared on `HikariPoolMXBean`. The initial
commit had the wrong call site. The fix uses the two-step chain that HikariCP
exposes:
```java
// Step 1: getHikariPoolMXBean() — public method on HikariDataSource
Method getPoolMXBean = ds.getClass().getMethod("getHikariPoolMXBean");
Object poolMXBean = getPoolMXBean.invoke(ds);
// Step 2: softEvictConnections() — declared on HikariPoolMXBean,
implemented by HikariPool
Method softEvict = poolMXBean.getClass().getMethod("softEvictConnections");
softEvict.invoke(poolMXBean);
```
Both steps use reflection so there's no compile-time dependency on HikariCP.
The eviction logic has also been extracted to
`DataSourceHelper.evictDataSourceConnections()` in `camel-support` so it's no
longer duplicated between the two components.
--
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]