Class ConsumerControllerImpl$
- java.lang.Object
-
- akka.actor.typed.delivery.internal.ConsumerControllerImpl$
-
public class ConsumerControllerImpl$ extends java.lang.ObjectINTERNAL API==== Design notes ====
The destination consumer will start the flow by sending an initial
Startmessage to theConsumerController.The
ProducerControllersends the first message to theConsumerControllerwithout waiting for aRequestfrom 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
ConsumerControllersendsProducerControllerImpl.Requestto theProducerControllerto specify it's ready to receive up to the requested sequence number.The
ConsumerControllersends the firstRequestwhen it receives the firstSequencedMessageand has received theStartmessage from the consumer.It sends new
Requestwhen half of the requested window is remaining, but it also retries theRequestif 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.Deliverywhen sent to the consumer, which is supposed to reply withConsumerController.Confirmedwhen 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 theConsumerControllerand 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
ProducerControllerandConsumerControllerit's window of messages in flight.The consumer and the
ConsumerControllerare supposed to be local so that these messages are fast and not lost.If the
ConsumerControllerreceives a message with unexpected sequence number (not previous + 1) it sendsProducerControllerImpl.Resendto theProducerControllerand 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)voidenforceLocalConsumer(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)
-
-