Here's a java implementation of rete that I worked on about 20 years ago https://github.com/sgt101/zeus/tree/master/src/zeus/rete
It might work!
It might work!
I may download everything again and see if I can get the test scenarios running with modern Java. I am so out of date with Java though - what's the accepted best version to run things with now that Oracle has made the license so eyepoppingly evil?