Using NiFi 1.18.0/1.20.0 and trying to run a Groovy Script to access a 
Hazelcast 3.9 cluster with a composite Java key.

I started with Matt Burgess' link 
(http://funnifi.blogspot.com/2016/02/executescript-using-modules.html) to try 
and work through the Hazelcast connection via Groovy. It appears that 
ExecuteScript picks up the JARs in the Module Directory listed, but I have 
issues at that point with a HazelcastSerialization issue. The cache composite 
Java keys are in a JAR file also located in the Module Directory but the error 
still exists.

If I move the Hazelcast 3.9 JARs as well as the composite Java keys to the NiFi 
./lib directory, the HazelcastSerialization error doesn't occur. But, from this 
StackOverflow link 
(https://stackoverflow.com/questions/45273594/nifi-adding-custom-lib-jar) Matt 
Burgess says that is not recommended because of class loading situations.

I couldn't find anything in the NiFi Admin Guide that talks about a directory 
to have other JAR files, it only talks about NAR files, so I'm not sure what 
the "proper" solution would be in this case, outside of building out a NAR with 
processors to do this work. Also, it doesn't seem possible to connect to a 3.x 
Hazelcast cluster from a 4.x JAR file. (Maybe I'm mistaken? But config values 
have changed. Group name -> Cluster name. No Group password, etc.) And we 
aren't migrating our cache to 4.x yet, so I cannot use the Hazelcast Controller 
Services.

Thoughts on a solution?

Thanks,
John

Reply via email to