简体   繁体   中英

WSO2 ESB environment-specific configuration

I installed WSO2 ESB instance, and I'm trying to figure out how to use dynamic endpoints depending on the environment (dev, qa, production).

My aim is to deploy the same .car file application (containing all the code and configuration) on all the environments , and having the endpoint configuration being automatically adapted.

I tried to use governance registry (as suggested here ) but as far as I understand, having the same endpoint deployed on different 'deploy paths' requires also creating/deploying different .car applications (modifying each service with a static reference to the proper environment, which kind of violates the idea of having configurable endpoints).

Which is the best way to approach the problem of deploying one application on three environments, without having static references into the code and avoiding scripts?

You have different solutions:

1) Using the ESB embedded regsitry.

Each instance of the ESB has the embedded registry with the endpoints of the environment. You would need to have a CAR application of the registry per environment (note that all the enpoints will have the same path).

http://wso2.com/library/articles/2014/03/development-and-deployment-of-c-app-based-artifacts-on-multiple-environments/

https://github.com/sohaniwso2/NewRepoArticle/tree/master/StudentRegistrationProject

2) Usign the Governance registry.

The governance registry have all the endpoints deployed (trunk - dev, qa, pro, etc.).

Each instance of the ESB defines the remote instance of the registry and mount to the path of the environment.

Once the endpoints are mounted, for the ESB you will have the endpoints of the environment, so the same endpoint works in each environment.

<remoteInstance url="https://host:port/registry">
   <id>instanceId</id>
   <username>username</username>
   <password>password</password>
</remoteInstance>

<mount path="/_system/governance" overwrite="true"> 
   <instanceId>instanceId</instanceId> 
   <targetPath>/_system/governance/qa</targetPath> 
</mount>

http://wso2.com/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM