Akka通过负载均衡器询问

编程入门 行业动态 更新时间:2024-10-10 13:18:33
本文介绍了Akka通过负载均衡器询问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有以下设置: [app-a Containers] <-[load balancer]-> [app-b Containers]

这些容器是Docker容器,并且为一组容器分配了DNS名称,例如app-a.marathon.mesos和app-b.marathon.mesos.

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.

现在,当app-a中的演员向app-b上的远程演员提问时,app-b的发件人将成为app-a.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.

这是一个很大的问题,因为现在,对提问者的答复可能会或可能不会到达–它可能会到达任何app-a容器.

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?

推荐答案

您的设置似乎实际上无法实现您的目标,因为违反了基本约束,即actor路径是唯一的这一事实. 我认为有2种选择:

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

    在收到答案后将要在app-a上执行的后续操作编码为消息本身,从而允许app-b实际执行它们(或app-a中的随机接收者). /p>

  • 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).

    更多推荐

    Akka通过负载均衡器询问

    本文发布于:2023-11-25 10:23:51,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1629382.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:均衡器   负载   Akka

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!