使用可靠的代理模式进行有保证的邮件传递时,Akka将邮件保留多少次?

编程入门 行业动态 更新时间:2024-10-14 18:20:48
本文介绍了使用可靠的代理模式进行有保证的邮件传递时,Akka将邮件保留多少次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Akka 2.1文档建议使用可靠的代理模式做有保证的消息传递,即,一条消息仅一次发送到收件人队列。为了确保在JVM崩溃时消息不会丢失,我相信消息存储在持久队列中。

The Akka 2.1 document suggests using the reliable proxy pattern to do guaranteed message delievery, i.e a message is delivery once and only once to the recipient queue. To make sure the message won't lost in case of JVM crashes, I believe the message is stored in persistent queue.

基本思想是从演员A到B,它将M发送到两个代理演员P和E,其中P在A一边,E在B一边。有关详细信息,请参见此图像

The basic idea is that to send message M from actor A to B, it sends M to two proxy actor P and E, where P is on A's side, and E is on B's side. See this image for detail

演员P和演员E是否需要自己的持久队列?从A发送到B的消息将被持久存储在P的队列和E的队列中,然后才被持久存储在B?

Does actor P as well as E need its own persistent queue? A message send from A to B will be persisted in P's queue and E's queue before being persisted in B?

推荐答案

自己不关心持久消息队列:它只是旨在使远程传递与本地传递一样可靠(在易失性网络所施加的不可靠性约束内)。因此,当JVM崩溃时,消息将丢失。

The pattern does not concern itself with persistent messages queues: it just aims at making remote delivery as reliable as local delivery (within the unreliability constraints imposed by a fallible network). Thus, when the JVM crashes messages will be lost.

这些参与者(P和E)在持久邮箱中不能很好地发挥作用,因为P将消息隐藏在内部,即不是坚持不懈。这样做会将他们从邮箱中取出。您需要调整模式以使P保留其内部队列。

These actors (P and E) do not play well with durable mailboxes, because P stashes the messages internally, i.e. not persistently. It takes them out of the mailbox to do so. You would need to adapt the pattern to have P persist its internal queue instead.

更多推荐

使用可靠的代理模式进行有保证的邮件传递时,Akka将邮件保留多少次?

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

发布评论

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

>www.elefans.com

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