DB Connection Pool Create based on notification
Issue
- We have a requirement to Refresh/Create New connection pool created by Fuse service based on notification received on queue.
- We are creating DB related beans at startup of service using below configuration
<bean class="org.apache.commons.dbcp2.BasicDataSource" id="dataSourceMAIN"
name="dataSourceMAIN" primary="true">
<property name="driverClassName" value="${dataSourceMAIN.MAIN.driverClassName}" />
<property name="url" value="${dataSourceMAIN.MAIN.url}" />
<property name="username" value="${dataSourceMAIN.MAIN.username}" />
<property name="password" value="${dataSourceMAIN.MAIN.password}" />
<property name="initialSize" value="5"/>
<property name="accessToUnderlyingConnectionAllowed" value="true"/>
<property name="connectionProperties"
value="${dataSourceMAIN.MAIN.connectionProperties}" />
</bean>
<bean id="txnManagerMAIN"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSourceMAIN" />
</bean>
<bean id="PROPAGATION_REQUIRES_MAIN" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="txnManagerMAIN" />
<property name="propagationBehaviorName" value="PROPAGATION_NESTED" />
</bean>
Environment
- Red Hat Fuse
- 7.2.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.