Reputation: 2628
I have an external properties file configured in nifi.properties in nifi.variable.registry.properties . I want to read this property in executeScript processor in python. I have used
str(context.getProperty('URL'))
but its not working
Upvotes: 1
Views: 2039
Reputation: 28634
VAR_URL = ${URL}
VAR_URL.evaluateAttributeExpressions(flowFile).getValue()
or if you don't want to declare property for your processor and you are sure the property declared somewhere, then you can use the following code:
context.newPropertyValue( '${URL}' ).evaluateAttributeExpressions().getValue()
Note: don't use double quotes around
${URL}
because this expression will be processed as a groovy-string before evaluating nifi expression...
Upvotes: 6