Akka ask through a load balancer

萝らか妹 提交于 2019-12-07 17:20:42

问题


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:

  1. Update your load balancer to support some kind of specific addressing

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!