简体   繁体   English

从 WSO2 EI 中的注册表属性文件读取数据库连接配置

[英]Reading database connection configuration from a registry properties file in WSO2 EI

We are doing a POC in WSO2 EI and developing an API for service orchestration.我们正在 WSO2 EI 中进行 POC,并开发用于服务编排的 API。 As part of it, I want to insert some data into a database.作为其中的一部分,我想将一些数据插入数据库。 In Integration Studio 8.0.0, I am using the DB report mediator to insert data.在 Integration Studio 8.0.0 中,我使用 DB 报告中介来插入数据。 Everything works fine when I hardcode the values as shown in the below screenshot.当我对值进行硬编码时,一切正常,如下面的屏幕截图所示。 在此处输入图像描述

Now, I want to read the database configurations from a properties file I created in registry config folder instead of hardcoding them.现在,我想从我在注册表配置文件夹中创建的属性文件中读取数据库配置,而不是对它们进行硬编码。 How can we achieve this?我们怎样才能做到这一点?

Below is the screenshot of the registry properties file.下面是注册表属性文件的屏幕截图。

在此处输入图像描述

AFAIK you can't read properties files from the registry as key/value pairs and use them in integrations without processing the content of the properties file with something like the ScriptMediator.据我所知,如果不使用 ScriptMediator 之类的东西处理属性文件的内容,您就无法从注册表中读取属性文件作为键/值对并在集成中使用它们。 But you can pass a properties file to the runtime and pick the values from there.但是您可以将属性文件传递给运行时并从那里选择值。 Please have a look at this document.请查看文档。

We can inject DB connection parameters from a properties file stored in EI/MI product home folders but still need to find how we can inject parameters from registry.我们可以从存储在 EI/MI 产品主文件夹中的属性文件中注入 DB 连接参数,但仍需要了解如何从注册表中注入参数。

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

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