AnsweredAssumed Answered

Activiti with Spring Boot and two datasources

Question asked by sebljun on Aug 24, 2015
Latest reply on Aug 26, 2015 by sebljun
I have set up a project with the Activiti Spring Boot configuration. Because I don't want to pollute the Activiti db with the tables related to the business logic of this application, I have set up two data sources:


@Bean
@Primary
@ConfigurationProperties(prefix="datasource.app")
public DataSource appDataSource() {
    return DataSourceBuilder.create().build();
}

@Bean
@ConfigurationProperties(prefix="datasource.activiti")
public DataSource activitiDataSource() {
    return DataSourceBuilder.create().build();
}


The appDataSource is marked as primary since I plan to make use of the autoconfig of JPA with it. What I'm wondering is how to configure Activiti to pick up the secondary activitiDataSource instead of appDataSource. Someone has posted a very similar and unanswered  question on Stack Overflow.

Outcomes