Class ConsumerController


  • public class ConsumerController
    extends java.lang.Object
    ConsumerController and ProducerController or WorkPullingProducerController 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 the ConsumerController. The ActorRef in the Start message is typically constructed as a message adapter to map the ConsumerController.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 with ConsumerController.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 the ConsumerController 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 the Start message is terminated.