perhaps the content of this post can help solve the problem.
https://www.baeldung.com/spring-boot-configure-multiple-datasources