2017-08-20 118 views
0

我想在Nifi中讀取配置文件(conf.txt)。根據這個文件提供的路徑,我想在nifi處理器中配置路徑(例如:hdfs文件路徑,輸入目錄路徑)。從Nifi的配置文件讀取

這是現有的處理器,或者我應該去一個自定義的處理器。

任何人都可以請幫助我。

回答

3

您可以將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}