I have one more doubt. Below I am using round-robin-group to route the message. Unfortunately my node (127.0.0.57:3000) got disconnected from the cluster.
What will happen in these scenarios. Whether the message will drop itself?
First, you should use the cluster aware routers and not define routee paths with addresses like that in config.
Consistent hashing group router is a kind of message based router.
The cluster routers will avoid unreachable nodes, but there can always be a short time before that is detected and then messages routed to such node will be sent to the void.
I went through Consistent hashing group router, I don’t know how ConsistentHashableEnvelope routerActor chooses routees.
I ran the sample code calculating meanWordLength.
for (String word : words) { workerRouter.tell(new ConsistentHashableEnvelope(word, word),
aggregator);
}
I gave as 2551, 2552 and 2553 ports
This is the text that will be analyzed - this is the text to find meanWordLength
If my all three members are up then, text, be will be done by worker actor running on port 2551 is will be done by worker actor running on port 2552 this, the, that, will, analyzed will be done by worker actor running on port 2553
So finally all the words in the text are processed and aggregatorActor calculates meanWordLength.
So my doubt is how ConsistentHashableEnvelope is working, how every time it delegates the word to same node without change.
If anyone of my node stopped (say 2553) then those words are automatically passed to other nodes (either 2551 or 2552)
It will send the word to the same place as long as there are no changes in the cluster membership (adding/removing nodes) and also then it will reduce the number of relocations. Described in more detail in the documentation.
Yes I understood this. I want to know how it will send the particular word to same place. Is there any mapping happening internally. If so how to override that