All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nbcp.myoql.db.es.EsConfig.kt Maven / Gradle / Ivy

The newest version!
package nbcp.myoql.db.es

import nbcp.myoql.db.comm.MyOqlBaseActionLogDefine
import nbcp.myoql.db.comm.MyOqlMultipleDataSourceDefine
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.stereotype.Component


//@Component
//@ConditionalOnClass(RestClient::class)
//@ConditionalOnProperty("spring.elasticsearch.uris")
//@Lazy
//class MyOqlEsConfig {
//    companion object {
//        private val logger = LoggerFactory.getLogger(this::class.java.declaringClass)
//    }
//
//    @Bean
//    @Lazy
//    fun myoqlEsDataSource(): RestClient {
//        return db.es.getRestClient(
//            config.getConfig("spring.elasticsearch.uris", ""),
//            config.getConfig("spring.elasticsearch.path-prefix", ""),
//            config.getConfig("spring.elasticsearch.timeout").AsInt()
//        )
//    }
//}

/**
 * 定义Es不同的数据源
 */
@Component
class EsIndexDataSource : MyOqlMultipleDataSourceDefine("app.es") {
}


@ConfigurationProperties(prefix = "app.es.log")
@Component
class EsTableLogProperties : MyOqlBaseActionLogDefine("app.es.log-default") {
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy