Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Nifi Custom processor not able to read the attributes from variable registry.

In Nifi custom processor configuring some attributes as expressions to read values from variable registry, but it is reading expression itself instead of reading its value.

Example Code as below.

protected static final PropertyDescriptor HOST = new PropertyDescriptor.Builder()
.name("Feed URL")
.description("Feed Service Host")


public void onTrigger(final ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {

final ComponentLog logger = getLogger();
try {
sessionFactoryReference.compareAndSet(null, sessionFactory);
String hostValue = context.getProperty(HOST).toString(); //

So from the above code if we print 'hostValue' its printing the expression as ${Feed-URL} instead of printing value of expression.


Issue got resolved, below piece of code did the magic.



Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.