Using Hazelcast MapListner in akka cluster framework
Using Hazelcast MapListner in akka cluster framework
I want to add a Hazelcast Map`
class appListner extends Actor with EntryAddedListener[String, String]{
override def entryAdded(event: EntryEvent[String, String]): Unit = {
logger.info("Entry Added:" + event)
// i want to update my local cache using the event.value
updateLocalcache(event.getValue) // which is in turn needs to update the cache implemented using actor
}
}
I am attaching map listner like below
addEntryListener(new appListner(), true)
I get error during runtime saying You cannot create an instance of [appListener] explicitly using the constructor (new).You have to use one of the 'actorOf' factory methods to create a new actor.
How do i now use actorOf for attaching appListner?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.