Ok, thanks for the responses.

I will be following https://github.com/akka/akka/issues/15412 
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fakka%2Fakka%2Fissues%2F15412&sa=D&sntz=1&usg=AFQjCNE5oAjECJec7zb_ZgIqRgG1zXoVBQ>
 
for the allow-local-routees.

I understand that I never can know for sure if there are routees or if they 
are working and that I might have to resend later. My main problem is that 
in a running system where all nodes already are connected with each other 
create a cluster aware router on the fly I would expect it to immediately 
contain the routees for the current cluster state already when I'm sending 
the first message. So even though there is no network error and the nodes 
are up and working fine my message will fail and I have to wait for a 
timeout and resend.

I would like my message to be processed right after the initial cluster 
state has been applied to the cluster aware router and right now it's still 
better to do a manual sleep of a second or so before sending my message 
than send a message that will fail with 100% certainty and wait for longer 
a timeout. There is absolutely no point in letting the Cluster aware router 
(that don't have local routees) to handle messages before it has gotten an 
intial cluster state because that will always fail so best would be if the 
cluster aware router could handle.

I've been looking at the source code, could ClusterRouterActor do 
addRoutees() in preStart or would that be a problem? As far as I can tell 
it uses cluster.readView to get the initial nodes directly but it doesn't 
do addRoutees before it get's a cluster state message back.

On Wednesday, June 18, 2014 3:20:40 PM UTC+3, Akka Team wrote:
>
> Hi Johannes,
>
> Thank you for reporting! It seems like allow-local-routees is a bit 
> confusing. I created a ticket: https://github.com/akka/akka/issues/15412 
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fakka%2Fakka%2Fissues%2F15412&sa=D&sntz=1&usg=AFQjCNE5oAjECJec7zb_ZgIqRgG1zXoVBQ>
>
>
>> How should I properly make sure the cluster aware routers get 
>> initialized? 
>>
>
> Since this kind of router is very dynamic, you cannot reliably detect that 
> there are available routees at all. At the point where it would return to 
> you "Hey, I am ready", it might be that all nodes are gone already because 
> of a network failure for example. You can use the GetRoutees message and 
> check if there are routees available, but it cannot guarantee that those 
> routees will be there when you want to use them. This is a general problem 
> and is not limited to initialization. 
>  
> There is also a relevant Note in the docs which you should consider:
>
> "The routee actors should be started as early as possible when starting 
> the actor system, because the router will try to use them as soon as the 
> member status is changed to 'Up'. If it is not available at that point it 
> will be removed from the router and it will only re-try when the cluster 
> members are changed"
>
> -Endre
>  
>
>> I'm attaching a test class that I can reproduce my case with. I'm using 
>> Akka 2.3.0.
>>
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>
> -- 
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
>  

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to