TheAkkaWay icon indicating copy to clipboard operation
TheAkkaWay copied to clipboard

pub/sub 这种,能否实现只让其中的一个sub 处理消息

Open scalaoop opened this issue 8 years ago • 1 comments

不想使用akka的clustering,N个sub,当pub发布消息后,仅让其中一个sub执行处理一次消息,其余的sub不会再重复去处理该消息. 该如何实现?

scalaoop avatar May 04 '17 06:05 scalaoop

@scalaoop 您好,是可以的,这一点在官方文档中也有介绍,具体的来说就是PublishSend

This is a point-to-point mode where each message is delivered to one destination, but you still do not have to know where the destination is located.

http://doc.akka.io/docs/akka/current/scala/distributed-pub-sub.html#Send

使用的话,您需要自己维护一个注册表的哦。

He-Pin avatar May 05 '17 15:05 He-Pin