我在nifi.variable.registry.properties中的nifi.properties中配置了外部属性文件。我想在python中的executeScript处理器中读取这个属性。我使用过str(context.getProperty('URL'))
但它没有用
VAR_URL = ${URL}
VAR_URL.evaluateAttributeExpressions(flowFile).getValue()
或者如果您不想为您的处理器声明属性并且您确定该属性在某处声明,那么您可以使用以下代码:
context.newPropertyValue( '${URL}' ).evaluateAttributeExpressions().getValue()
注意:不要在
${URL}
周围使用双引号,因为在评估nifi表达式之前,此表达式将被处理为groovy-string ...