Closed AnithaPerumalsamy closed 1 day ago
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.
We are basically trying to acheive password change without restart of service as defined in https://blog.jdriven.com/2021/06/configure-hikari-connection-pool-when-using-rds-iam/ Implemented as shown below in the snippet I have to call the CustomDatasource with new keyword as we have to create new connection as its Multitenant enabled service
serviceA bean is null in getPassword() method in CustomDatasource
@Service public class CustomDatasource extends HikariDataSource {
}
@Service public class HikariDataSourceBuilder {
CacheStore.getCache().setDataSource(new CustomDatasource(getHikariConfig(tenantId));
public HikariConfig getHikariConfig(String tenant) { return hikariConfig; } }
@Service public class ServiceA {
public String someMethod() { return ""; } }
Options tried Made CustomDatasource as @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE), so that everytime new instance of the class is returned, and made changes to get the bean from Application context in HikariDataSourceBuilder.java class Tried few other options by defining Postcontruct in CustomDatasource and also by changing the way ServiceA set in CustomDatasource