Class ConsumerController$
- java.lang.Object
-
- akka.actor.typed.delivery.ConsumerController$
-
public class ConsumerController$ extends java.lang.Object
ConsumerController
andProducerController
orWorkPullingProducerController
are used together. See the descriptions in those classes or the Akka reference documentation for how they are intended to be used.The destination consumer actor will start the flow by sending an initial
ConsumerController.Start
message to theConsumerController
. TheActorRef
in theStart
message is typically constructed as a message adapter to map theConsumerController.Delivery
to the protocol of the consumer actor.Received messages from the producer 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.The consumer and the
ConsumerController
actors are supposed to be local so that these messages are fast and not lost. This is enforced by a runtime check.The
ConsumerController
is automatically stopped when the consumer that registered with theStart
message is terminated.
-
-
Field Summary
Fields Modifier and Type Field Description static ConsumerController$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description ConsumerController$()
-
Method Summary
-
-
-
Field Detail
-
MODULE$
public static final ConsumerController$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
deliveryClass
public <A> java.lang.Class<ConsumerController.Delivery<A>> deliveryClass()
Java API: The genericClass
type forConsumerController.Delivery
that can be used when creating amessageAdapter
forClass
.>
-
serviceKeyClass
public <A> java.lang.Class<ConsumerController.Command<A>> serviceKeyClass()
Java API: The genericClass
type forConsumerController.Command
that can be used when creating aServiceKey
forClass
.>
-
confirmed
public ConsumerController.Confirmed confirmed()
Java API: the singleton instance of the Confirmed message. When the message has been processed the consumer is supposed to sendConfirmed
back to theConsumerController
via theconfirmTo
in theDelivery
message.
-
apply
public <A> Behavior<ConsumerController.Command<A>> apply()
-
apply
public <A> Behavior<ConsumerController.Command<A>> apply(ConsumerController.Settings settings)
-
apply
public <A> Behavior<ConsumerController.Command<A>> apply(ServiceKey<ConsumerController.Command<A>> serviceKey)
To be used withWorkPullingProducerController
. It will register itself to theReceptionist
with the givenserviceKey
, and theWorkPullingProducerController
subscribes to the same key to find active workers.
-
apply
public <A> Behavior<ConsumerController.Command<A>> apply(ServiceKey<ConsumerController.Command<A>> serviceKey, ConsumerController.Settings settings)
-
create
public <A> Behavior<ConsumerController.Command<A>> create()
Java API
-
create
public <A> Behavior<ConsumerController.Command<A>> create(ConsumerController.Settings settings)
Java API
-
create
public <A> Behavior<ConsumerController.Command<A>> create(ServiceKey<ConsumerController.Command<A>> serviceKey)
Java API: To be used withWorkPullingProducerController
. It will register itself to theReceptionist
with the givenserviceKey
, and theWorkPullingProducerController
subscribes to the same key to find active workers.
-
create
public <A> Behavior<ConsumerController.Command<A>> create(ServiceKey<ConsumerController.Command<A>> serviceKey, ConsumerController.Settings settings)
Java API
-
-