问题
I have the following setup:
[app-a Containers] <-[load balancer]-> [app-b Containers]
The containers are Docker containers and a set of containers are assigned a DNS name like app-a.marathon.mesos
and app-b.marathon.mesos
.
Now when an actor in app-a
makes an ask to a remote actor on app-b
, the app-b
's sender becomes app-a.marathon.mesos
.
This is tremendously problemmatic because now, the reply to the asking actor may or may not arrive – it may arrive at any of the app-a
containers.
What is the best way to overcome this?
回答1:
Your setup seems to make it actually impossible to implement your goal because a basic constraint, the fact that the actor path is unique is violated. I think there are 2 options:
Update your load balancer to support some kind of specific addressing
Encode the follow-up operations you want to execute on app-a upon receiving the answer into the message itself, allowing the app-b to actually execute them (or the random receiver in app-a).
来源:https://stackoverflow.com/questions/32461282/akka-ask-through-a-load-balancer