Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Node.js / NPM modules in Apache Nifi ExecuteScript

Node.js / NPM modules in Apache Nifi ExecuteScript

What is the best way to use NPM modules in NiFi's ExecuteScript processor? I was thinking about trying to bundle the source and deps with some build tool like Browserify. Anyone tried this sort of thing?

1 REPLY 1
Highlighted

Re: Node.js / NPM modules in Apache Nifi ExecuteScript

Super Guru

Interesting use case! I haven't tried it myself, but somehow you'd have to set up all the dependencies such that ExecuteScript (with Nashorn) could find the JS stuff, but that it could call out to the Node.js runtime.

An alternative approach might be Avatar.js, you could include their JAR dependencies in the Module Directory property, then conceivably use any of the supported modules. Although from their deployment model it almost looks like you'd need to run NiFi inside the Avatar server...

Yet another approach could be to run a web service from Node and hit it with InvokeHttp or a similar processor.

Don't have an account?
Coming from Hortonworks? Activate your account here