This is an implementation of Ninja Frameworks Cache interface for hazelcast.
Its structure is somehow based on svenkubiak's excellent MongoDB module (discontinued) and therefore it is an easys plugable jar, which you just have to add to your Ninja-powered projects dependencies.
This plugin gives you the possibility to start a hazelcast instance with every Ninja app you deploy and let them automatically join to a cluster (first node starts the cluster).
To use it, just add this to your application.conf:
Specify the interface and port on which hazelcast should be listening for incoming clustering requests:
In addition you should specify the multicast address which this cluster member should join:
So you get a fail-safe, reliable cache which grows with every Ninja instance serving your application.
You dont want wild spreading cache cluster? No problem. Just configure the group settings in your application.conf like so:
Now you can separate the caches from each other even if you are running them in the same address range.
!! Please note !!
You should really not run your cache on interfaces/addresses which are publicly available. Even if you have a group config in place, which is mandatory for this plugin, you should run your cache on interfcaces connected to a separate and firewalled subnet. Unfortunately hazelcast supports TLS and fine granular access control only in enterprise version at the moment. Keep that in mind when designing your application.