Package io.spring.configuration
Class ExternalDataSourceConfiguration
java.lang.Object
io.spring.configuration.ExternalDataSourceConfiguration
@Configuration(proxyBeanMethods=false)
@Profile("external")
public class ExternalDataSourceConfiguration
extends Object
Creates two data sources that use external databases.
- Author:
- Glenn Renfro
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondataSource
(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties springDataSourceProperties) org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
secondDataSource
(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties secondDataSourceProperties) org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
-
Constructor Details
-
ExternalDataSourceConfiguration
public ExternalDataSourceConfiguration()
-
-
Method Details
-
springDataSourceProperties
@Bean(name="springDataSourceProperties") @ConfigurationProperties("spring.datasource") @Primary public org.springframework.boot.autoconfigure.jdbc.DataSourceProperties springDataSourceProperties() -
myDataSourceProperties
@Bean(name="secondDataSourceProperties") @ConfigurationProperties("second.datasource") public org.springframework.boot.autoconfigure.jdbc.DataSourceProperties myDataSourceProperties() -
dataSource
@Bean(name="springDataSource") @Primary public DataSource dataSource(@Qualifier("springDataSourceProperties") org.springframework.boot.autoconfigure.jdbc.DataSourceProperties springDataSourceProperties) -
secondDataSource
@Bean public DataSource secondDataSource(@Qualifier("secondDataSourceProperties") org.springframework.boot.autoconfigure.jdbc.DataSourceProperties secondDataSourceProperties)
-