npe
npe

Reputation: 1

How to enable spring AOT compiling to executable while the project using spring-boot AbstractRoutingDataSource?

Our project using two DataSource, So we're using AbstractRoutingDataSource + AOP to switch dataSource before application service method invoked. Service like:

@Service
public class AServiceImpl implements AService {
    @Autowired private JdbcTemplate jdbcTemplate;

    // Business method here...
}

This method works fine under tradinally running way.

But while we try to compile to executable with spring aot + graalvm, we found AOP works fine(logger shows that datasource keys changed), but in the service, Datasource doesn't changing: It's always running under the default one.

Anyone knows how to fix it?

run as native executable.

Upvotes: 0

Views: 147

Answers (0)

Related Questions