使用可靠的代理模式进行有保证的邮件传递时,Akka将邮件保留多少次? [英] how many times does Akka persist a message when using reliable proxy pattern to do guaranteed message delievery?

查看:50
本文介绍了使用可靠的代理模式进行有保证的邮件传递时,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将邮件保留多少次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆