简体   繁体   English

WSO2 ESB环境特定的配置

[英]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). 我安装了WSO2 ESB实例,并且试图根据环境(开发,质量保证,生产)使用动态端点。

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. 我的目标是在所有环境中部署相同的.car文件应用程序(包含所有代码和配置),并使端点配置自动适应。

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. 1)使用ESB嵌入式注册表。

Each instance of the ESB has the embedded registry with the endpoints of the environment. ESB的每个实例都具有包含环境端点的嵌入式注册表。 You would need to have a CAR application of the registry per environment (note that all the enpoints will have the same path). 您将需要针对每个环境使用注册表的CAR应用程序(请注意,所有enpoints都将具有相同的路径)。

http://wso2.com/library/articles/2014/03/development-and-deployment-of-c-app-based-artifacts-on-multiple-environments/ 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 https://github.com/sohaniwso2/NewRepoArticle/tree/master/StudentRegistrationProject

2) Usign the Governance registry. 2)Usign治理注册表。

The governance registry have all the endpoints deployed (trunk - dev, qa, pro, etc.). 治理注册表已部署了所有端点(trunk-dev,qa,pro等)。

Each instance of the ESB defines the remote instance of the registry and mount to the path of the environment. ESB的每个实例都定义注册表的远程实例,并安装到环境的路径。

Once the endpoints are mounted, for the ESB you will have the endpoints of the environment, so the same endpoint works in each environment. 安装端点之后,对于ESB,您将拥有环境的端点,因此在每个环境中都可以使用相同的端点。

<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/ http://wso2.com/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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