处理器中的Apache Nifi读取配置属性

hem*_*vsn 0 java apache-nifi

我们可以在自定义处理器中读取nifi.properties中设置的属性吗?例如:如果我们添加自定义属性nifi.active.profile = dev/qa

并在自定义处理器中读取其值?

或者在启动NIFI传递争论时,我们可以稍后阅读

dag*_*ett 5

您可以使用nifi.variable.registry.properties参数nifi.properties来定义自定义属性文件

例如:

nifi.variable.registry.properties=./conf/custom.properties
Run Code Online (Sandbox Code Playgroud)

custom.properties您定义的所有属性都可以使用nifi表达式语言进行访问.

如果你有

nifi.active.profile=dev
Run Code Online (Sandbox Code Playgroud)

然后你可以用nifi表达式语言访问它:

${nifi.active.profile}
Run Code Online (Sandbox Code Playgroud)

回报 dev

${nifi.active.profile:toUpper()}
Run Code Online (Sandbox Code Playgroud)

回报 DEV