WSO2 ESB - 数据服务服务器功能 - 如何使用数据源即时交换数据源 [英] WSO2 ESB - Data Services Server Feature - How to use Data Sources to swap data source on fly
问题描述
我正在使用 WSO2 ESB 4.0.3.我已经在上面安装了 WSO2 数据服务功能并创建了 DS.
I am using WSO2 ESB 4.0.3. I have installed WSO2 Data Services Feature on it and I have created DS.
在 ESB 的管理 UI 下的配置"选项卡下有一个功能,您可以在其中定义数据源".
There is feature in the ESB under "Configure" tab under admin UI where you can define the "Data Source".
我的问题是在创建新的数据服务时,我无法使用我在 ESB 中配置的这个数据源".我们有不同的环境 DEV/TEST/UAT/PROD.每个环境对于相同的数据服务都有不同的数据库.
My question is while creating new Data Service I am not able to use this "Data Source" which I have configured in ESB. We have different environments DEV / TEST / UAT / PROD. Each environment has different data base for same data service.
目前我已手动更改 DS XML 文件以指向新数据库,然后进行部署.
Currently I have manually change the DS XML file to point to new DB and then deploy.
有没有办法指向 ESB 中配置的 DB 并动态更改 DS 的 DB?
Is there a way to point to the DB configured in ESB and change the DB for DS on the fly?
谢谢阿比吉特
07/01/2012 -请问有这方面的更新吗?这是他们大团队中的 Apple POC.如果成功 WSO2 将有 Apple 实施?
07/01/2012 - Any update on this please ? This is Apple POC in their big group. If suceedded WSO2 will have Apple implementation?
推荐答案
#----- Start of the configuration -----
synapse.datasources=TestDS,TestDS1
synapse.datasources.icFactory=com.sun.jndi.rmi.registry.RegistryContextFactory
synapse.datasources.providerPort=2199
#TestDS Configuration
synapse.datasources.TestDS.registry=JNDI
synapse.datasources.TestDS.type=BasicDataSource
synapse.datasources.TestDS.driverClassName=com.mysql.jdbc.Driver
synapse.datasources.TestDS.url=jdbc:mysql://localhost:3306/testDB
synapse.datasources.TestDS.username=dummy_username
synapse.datasources.TestDS.password=dummy_password
synapse.datasources.TestDS.dsName=TestDS
synapse.datasources.TestDS.maxActive=100
synapse.datasources.TestDS.maxIdle=20
synapse.datasources.TestDS.maxWait=10000
#TestDS1 configuration
synapse.datasources.TestDS1.registry=JNDI
synapse.datasources.TestDS1.type=BasicDataSource
synapse.datasources.TestDS1.driverClassName=com.mysql.jdbc.Driver
synapse.datasources.TestDS1.url=jdbc:mysql://localhost:3306/testDB1
synapse.datasources.TestDS1.username=dummy_username
synapse.datasources.TestDS1.password=dummy_password
synapse.datasources.TestDS1.dsName=TestDS1
synapse.datasources.TestDS1.maxActive=100
synapse.datasources.TestDS1.maxIdle=20
synapse.datasources.TestDS1.maxWait=10000
#----- End of the configuration -----
这篇关于WSO2 ESB - 数据服务服务器功能 - 如何使用数据源即时交换数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!