Akka stream ActorSubscriber not working with remote participants

http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-M2/scala/stream-integrations.html says:

"ActorPublisher and ActorSubscriber cannot be used with remote participants, because if Reactive Streams protocol signals (such as a request) are lost, the stream may be blocked."

Does this mean the akka stream is not transparent? How to use akka stream to develop a back pressure client-server system where client and server are on different machines?

I must have misunderstood something. Thanks for any clarification.

+3


source to share


2 answers


They are currently strictly localized . You can hook it up to a TCP sink / source and it will apply backpressure using TCP though (which is what Akka Http does).



+2


source


How do I use akka stream to create a back pressure client-server system where the client and server are on different machines?

View flows in Artery (Dec 2016, so 18 months later):

A new implementation of remote operations for messages with actors was released in Akka 2.4.11 two months ago.
Artery is a codename. It is a replacement for old remote access in many cases, but the implementation is completely new and contains many important improvements.



(Remoting allows Actor systems on different hosts or JVMs to communicate with each other)

Regarding backpressure, this is not a complete solution, but it might help:

How about back pressure? Akka Streams is all about backup pressure, but messaging with actors is an immediate and carefree forgetting. How is this handled in this project?

We cannot magically add back pressure to the exchange of actors. This should still be done at the application level using message flow control techniques like acknowledgments, pulls, throttles.

When a message is sent to a remote destination, it is added to the queue processed by the first stage called SendQueue

. This queue is limited, and if it gets full, messages will be dropped, which is consistent with the actor's message passing most important in delivery. A large number of messages should not be sent without application-level flow control. For example, if the serialization of messages is slow and does not depend on the sending rate, this queue will overflow.

Aeron will propagate backpressure from the receiving node to the sending node, that is AeronSink

, it will not develop in the outgoing stream if it AeronSource

is slower at the other end and the buffers are full.
If messages are sent at a faster rate than what can be used to receive a node, the overflow SendQueue

and messages will be removed. Aeron

itself has large buffers to handle burst messages.

The same will happen in the case of a network partition. When Aeron buffers are full, messages will be discarded by SendQueue.

In the incoming stream, messages are sent at the end to the recipient. This is an ordinary actor who will report that he will display a message in the mailbox of the actors. This is where the back pressure ends at the receiving end. If the actor is running slower than the speed of the incoming message, the mailbox will fill up as usual .

Bottom line, flow control for actor messages must be implemented at the application level. The artery does not change this fact .

+2


source







All Articles