How to configure multiple pooled/xa datasources in camel4springboot?
Issue
- How to configure multiple pooled/xa datasources in camel4springboot?
- We defined the Pool in this way (we have different datasource)
@Bean()
@Primary
public DataSource oracleDSTmRtm(TransactionManager transactionManager, XARecoveryModule xaRecoveryModule)
throws Exception {
OracleXADataSource oracle2XaDataSource = new OracleXADataSource();
oracle2XaDataSource.setURL();
oracle2XaDataSource.setUser();
oracle2XaDataSource.setPassword();
Map<String, String> properties = new HashMap<>();
properties.put("maxTotal", "25");
PooledXADataSourceWrapper wrapper = new PooledXADataSourceWrapper(transactionManager, xaRecoveryModule,
properties);
return wrapper.wrapDataSource(oracle2XaDataSource);
return oracle2XaDataSource;
}
<dependency>
<groupId>io.agroal</groupId>
<artifactId>agroal-spring-boot-starter</artifactId>
<version>2.4</version>
</dependency>
Environment
Red Hat build of Apache Camel for Spring Boot
4.0.3
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.