从 Nifi 中的配置文件中读取
Read from a configuration file in Nifi
我正在尝试读取 Nifi 中的配置文件(conf.txt)。根据此文件中提供的路径,我想在 nifi 处理器中配置路径(例如:hdfs 文件路径、输入目录路径)。
是否可以使用现有的处理器,或者我应该使用自定义处理器。
谁能帮我解决这个问题。
您可以将 custom properties 配置为 Apache NiFi 变量注册表功能的一部分,这使得您的外部文件的属性可用于 NiFi 表达式语言表达式。使用表达式语言,您可以使用外部定义的变量配置许多处理器。
conf/nifi.properties
# external properties files for variable registry
# supports a comma delimited list of file locations
nifi.variable.registry.properties=./conf/custom.properties
conf/custom.properties
my.prop1=value1
my.prop2=value2
...
在表达式中
${my.prop1}
我正在尝试读取 Nifi 中的配置文件(conf.txt)。根据此文件中提供的路径,我想在 nifi 处理器中配置路径(例如:hdfs 文件路径、输入目录路径)。
是否可以使用现有的处理器,或者我应该使用自定义处理器。
谁能帮我解决这个问题。
您可以将 custom properties 配置为 Apache NiFi 变量注册表功能的一部分,这使得您的外部文件的属性可用于 NiFi 表达式语言表达式。使用表达式语言,您可以使用外部定义的变量配置许多处理器。
conf/nifi.properties
# external properties files for variable registry
# supports a comma delimited list of file locations
nifi.variable.registry.properties=./conf/custom.properties
conf/custom.properties
my.prop1=value1
my.prop2=value2
...
在表达式中
${my.prop1}