Class ConsumerControllerImpl$
- java.lang.Object
-
- akka.actor.typed.delivery.internal.ConsumerControllerImpl$
-
public class ConsumerControllerImpl$ extends java.lang.Object
INTERNAL API==== Design notes ====
The destination consumer will start the flow by sending an initial
Start
message to theConsumerController
.The
ProducerController
sends the first message to theConsumerController
without waiting for aRequest
from theConsumerController
. The main reason for this is that when used with Cluster Sharding the first message will typically create theConsumerController
. It's also a way to connect the ProducerController and ConsumerController in a dynamic way, for example when the ProducerController is replaced.The
ConsumerController
sendsProducerControllerImpl.Request
to theProducerController
to specify it's ready to receive up to the requested sequence number.The
ConsumerController
sends the firstRequest
when it receives the firstSequencedMessage
and has received theStart
message from the consumer.It sends new
Request
when half of the requested window is remaining, but it also retries theRequest
if no messages are received because that could be caused by lost messages.Apart from the first message the producer will not send more messages than requested.
Received messages are wrapped in
ConsumerController.Delivery
when sent to the consumer, which is supposed to reply withConsumerController.Confirmed
when it has processed the message. Next message is not delivered until the previous is confirmed. More messages from the producer that arrive while waiting for the confirmation are stashed by theConsumerController
and delivered when previous message was confirmed.In other words, the "request" protocol to the application producer and consumer is one-by-one, but between the
ProducerController
andConsumerController
it's window of messages in flight.The consumer and the
ConsumerController
are supposed to be local so that these messages are fast and not lost.If the
ConsumerController
receives a message with unexpected sequence number (not previous + 1) it sendsProducerControllerImpl.Resend
to theProducerController
and will ignore all messages until the expected sequence number arrives.
-
-
Field Summary
Fields Modifier and Type Field Description static ConsumerControllerImpl$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description ConsumerControllerImpl$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A> Behavior<ConsumerController.Command<A>>
apply(scala.Option<ServiceKey<ConsumerController.Command<A>>> serviceKey, ConsumerController.Settings settings)
void
enforceLocalConsumer(ActorRef<?> ref)
-
-
-
Field Detail
-
MODULE$
public static final ConsumerControllerImpl$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
apply
public <A> Behavior<ConsumerController.Command<A>> apply(scala.Option<ServiceKey<ConsumerController.Command<A>>> serviceKey, ConsumerController.Settings settings)
-
enforceLocalConsumer
public void enforceLocalConsumer(ActorRef<?> ref)
-
-