我可以在一个地方获得所有适配器的配置吗?例如,我需要存储连接字符串,我的mobilefirst服务器所需的http服务器地址。 Mobilefirst 8.0版。 谢谢您的提前!
答案 0 :(得分:2)
在MobileFirst Foundation 8.0中,您有以下选择:
如果使用JavaScript适配器:
使用此方法不会导致服务器停机。
参见"推拉配置"话题:https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/javascript-adapters/
可以使用“配置文件”选项卡中的适配器配置文件共享自定义适配器属性 为此,请使用下面描述的pull和push命令。对于要共享的属性,您需要更改为属性提供的默认值。
将DmfpfConfigFile占位符替换为实际值,例如:config.json。然后,从适配器Maven项目的根文件夹运行命令:
- 提取配置文件 -
mvn adapter:configpull -DmfpfConfigFile=<path to a file that will store the configuration>
。- 推送配置文件 -
mvn adapter:configpush -DmfpfConfigFile=<path to the file that stores the configuration>
。
如果使用Java适配器,
您可以将JNDI属性添加到应用程序服务器的server.xml,并使用configurationAPI(getServerJNDIProperty)可以在每个适配器中读取这些属性。但请注意,通过使用server.xml,只要您想要更新连接属性列表,就会导致停机。