Hi Dirk, You're definitely not the odd one out there using JS with NiFi. The most common usage is definitely Groovy but I'm aware of NiFi users using JS. I'm not aware of a specific timeline as I don't know if someone in the community is actively looking into it right now but I agree that this should be something to take into account for NiFi 2.0.
Pierre Le ven. 15 sept. 2023 à 10:03, Dirk Arends <dirk.are...@fontis.com.au> a écrit : > I'm still having several issues with JS scripting in Nifi: > > 1. Nifi versions past 1.14 take a very long time to validate JS scripted > processors, to the point where processor validation starts timing out and > failing. I haven't created an issue specifically about this as we don't > have simple instructions to replicate, but I can document this if it would > help. > > 2. In the long term, relying on Nashorn means I can't upgrade to a JDK > version higher than JDK11, and won't be able to use Nifi 2.x when it > releases. > > 3. Nashorn only fully supports ES5.1, with some support for ES6 features. > This means I have to use several polyfills, making scripts larger and > (probably) contributing to startup time issues. For example, a 100 line > source script becomes ~4000 lines to make modern Javascript run > consistently. I have experimented with enabling and disabling various Babel > plugins and polyfills but have not been able to achieve a consistent > result. > > These issues above and my reliance on JS scripting means I can't upgrade > Nifi past 1.14 in production. Not being able to upgrade means not getting > any of the new Nifi features and improvements, which is becoming > increasingly difficult. Is anybody else impacted by these issues? > > David mentioned that there are plans to entirely redo the scripting > implementation in Nifi 2.x: > > https://lists.apache.org/thread/ssc19kxoz89g0y0wcfvb410f4x1qwkdg > > Is there a timeline yet, or is JS scripting going to be unavailable in > modern Nifi for the foreseeable future? > > One potential option is replacing Nashorn with Graal - see comments here: > > https://issues.apache.org/jira/browse/NIFI-6229 > > The impression I have is that using scripted processors is fairly common > and a popular feature, but maybe most other people use Python or Groovy and > I'm the odd one out using JS? > > > Dirk Arends >