I have a question please towards routing an event to remote actors:
Lets say I have node A hosting Akka actor A1, and node B hosting Akka actors B1 and B2.
A1 needs to send the same event to B1 and B2, however the event should only get serialized and transported to node B once, since there can be many B actors.
Is there an optimization or abstraction within Akka to make sure it is transported only once or do I need to write my own router perhaps?
Hi Tom,
You don't have to write your own router, you can use one from Akka.
Create a router Br on node B and have it forward the message to your
B1...Bn actors.
In your particular case the BroadcastRouter seems to be the right candidate.
See http://doc.akka.io/docs/akka/2.0.1/scala/routing.html Cheers
//Henrik
On Tue, May 1, 2012 at 9:00 PM, Thomas Bernhardt <bernhardt...@yahoo.com> wrote:
> I have a question please towards routing an event to remote actors:
> Lets say I have node A hosting Akka actor A1, and node B hosting Akka actors
> B1 and B2.
> A1 needs to send the same event to B1 and B2, however the event should only
> get serialized and transported to node B once, since there can be many B
> actors.
> Is there an optimization or abstraction within Akka to make sure it is
> transported only once or do I need to write my own router perhaps?
> Thank you!
> Best regards,
> Tom
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
The concern I would have is that I don't want my code to know where these B1..Bn actors live. For example, they could be B1..B10 on node B and B11 to B13 on node C (distributed in any random fashion). I would like Akka and Akka Cluster to know where these actors currently live and route accordingly. Is this type feature on the Akka roadmap please?
Best regards, Tom
________________________________ From: Henrik Engström <henrik.engst...@gmail.com> To: akka-user@googlegroups.com Sent: Wednesday, May 2, 2012 1:23 AM Subject: Re: [akka-user] Event routing question
Hi Tom, You don't have to write your own router, you can use one from Akka. Create a router Br on node B and have it forward the message to your B1...Bn actors. In your particular case the BroadcastRouter seems to be the right candidate. See http://doc.akka.io/docs/akka/2.0.1/scala/routing.html Cheers //Henrik
On Tue, May 1, 2012 at 9:00 PM, Thomas Bernhardt <bernhardt...@yahoo.com> wrote: > I have a question please towards routing an event to remote actors: > Lets say I have node A hosting Akka actor A1, and node B hosting Akka actors > B1 and B2. > A1 needs to send the same event to B1 and B2, however the event should only > get serialized and transported to node B once, since there can be many B > actors. > Is there an optimization or abstraction within Akka to make sure it is > transported only once or do I need to write my own router perhaps?
> Thank you! > Best regards, > Tom
> -- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To post to this group, send email to akka-user@googlegroups.com. > To unsubscribe from this group, send email to > akka-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/akka-user?hl=en.
-- You received this message because you are subscribed to the Google Groups "Akka User List" group. To post to this group, send email to akka-user@googlegroups.com. To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
On Wed, May 2, 2012 at 1:58 PM, Thomas Bernhardt <bernhardt...@yahoo.com> wrote:
> Thank you Henrik.
> The concern I would have is that I don't want my code to know where these
> B1..Bn actors live. For example, they could be B1..B10 on node B and B11 to
> B13 on node C (distributed in any random fashion). I would like Akka and
> Akka Cluster to know where these actors currently live and route
> accordingly. Is this type feature on the Akka roadmap please?
> Best regards,
> Tom
> ________________________________
> From: Henrik Engström <henrik.engst...@gmail.com>
> To: akka-user@googlegroups.com
> Sent: Wednesday, May 2, 2012 1:23 AM
> Subject: Re: [akka-user] Event routing question
> Hi Tom,
> You don't have to write your own router, you can use one from Akka.
> Create a router Br on node B and have it forward the message to your
> B1...Bn actors.
> In your particular case the BroadcastRouter seems to be the right candidate.
> See http://doc.akka.io/docs/akka/2.0.1/scala/routing.html > Cheers
> //Henrik
> On Tue, May 1, 2012 at 9:00 PM, Thomas Bernhardt <bernhardt...@yahoo.com>
> wrote:
>> I have a question please towards routing an event to remote actors:
>> Lets say I have node A hosting Akka actor A1, and node B hosting Akka
>> actors
>> B1 and B2.
>> A1 needs to send the same event to B1 and B2, however the event should
>> only
>> get serialized and transported to node B once, since there can be many B
>> actors.
>> Is there an optimization or abstraction within Akka to make sure it is
>> transported only once or do I need to write my own router perhaps?
>> Thank you!
>> Best regards,
>> Tom
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To post to this group, send email to akka-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/akka-user?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.