我们可以在自定义处理器中读取 nifi.properties 中设置的属性吗? 例如: 如果我们添加一个自定义属性 nifi.active.profile = dev/qa
并在自定义处理器中读取其值?
或者在启动 NIFI 时传递争论,我们稍后可以阅读
最佳答案
您可以使用nifi.properties
中的nifi.variable.registry.properties
参数来定义自定义属性文件
例如:
nifi.variable.registry.properties=./conf/custom.properties
以及 custom.properties
中定义的所有属性,您可以使用 nifi 表达式语言访问。
如果你有
nifi.active.profile=dev
然后你就可以在 nifi expression language 中访问它:
${nifi.active.profile}
返回dev
${nifi.active.profile:toUpper()}
返回DEV
关于java - Apache Nifi 读取处理器中的配置属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44605954/