Hi,
In my app, I need to tell a QueueProcessor actor to start processing queue events after the cluster is formed and processing result will be sent to persistent actors. At the moment, I start queue processing after the following code, which I think it is not appropriate:
// Akka Management hosts the HTTP routes used by bootstrap
AkkaManagement(system).start()
// Starting the bootstrap process needs to be done explicitly
ClusterBootstrap(system).start()
I am thinking two possible ways:
- ClusterBootstrap(system).start() returns a Future telling the result of bootstrap, but this is not offered.
- Listening to cluster formed event, which I don’t know which one I should listen to? Shall I listen to ClusterEvent.LeaderChanged and judge based on whether leader is empty or not?
Please help me out. Thanks.
Cheng