Packages

o

akka.actor.typed.delivery

ConsumerController

object ConsumerController

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.

Annotations
@ApiMayChange()
Source
ConsumerController.scala
Linear Supertypes
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConsumerController
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. sealed trait Command[+A] extends UnsealedInternalCommand
  2. trait Confirmed extends UnsealedInternalCommand
    Annotations
    @DoNotInherit()
  3. final case class DeliverThenStop[A]() extends Command[A] with Product with Serializable
  4. final class Delivery[A] extends AnyRef

    Received messages from the producer are wrapped in Delivery when sent to the consumer.

    Received messages from the producer are wrapped in Delivery when sent to the consumer. When the message has been processed the consumer is supposed to send Confirmed back to the ConsumerController via the confirmTo.

  5. final case class RegisterToProducerController[A](producerController: ActorRef[ProducerController.Command[A]]) extends Command[A] with Product with Serializable

    Register the ConsumerController to the given producerController.

    Register the ConsumerController to the given producerController. It will retry the registration until the ProducerConsumer has acknowledged by sending its first message.

    Alternatively, this registration can be done on the producer side with the ProducerController.RegisterConsumer message.

  6. type SeqNr = Long
  7. final case class SequencedMessage[A](producerId: String, seqNr: SeqNr, message: MessageOrChunk, first: Boolean, ack: Boolean)(producerController: ActorRef[InternalCommand]) extends Command[A] with DeliverySerializable with DeadLetterSuppression with Product with Serializable

    This is used between the ProducerController and ConsumerController.

    This is used between the ProducerController and ConsumerController. Should rarely be used in application code but is public because it's in the signature for the EntityTypeKey when using ShardingConsumerController.

    In the future we may also make the custom send in ProducerController public to make it possible to wrap it or send it in other ways when building higher level abstractions that are using the ProducerController. That is used by ShardingProducerController.

    producerController

    INTERNAL API: construction of SequencedMessage is internal

  8. final class Settings extends AnyRef
  9. final case class Start[A](deliverTo: ActorRef[Delivery[A]]) extends Command[A] with Product with Serializable

    Initial message from the consumer actor.

    Initial message from the consumer actor. The deliverTo is typically constructed as a message adapter to map the Delivery to the protocol of the consumer actor.

    If the producer is restarted it should send a new Start message to the ConsumerController.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply[A](serviceKey: ServiceKey[Command[A]], settings: Settings): Behavior[Command[A]]
  5. def apply[A](serviceKey: ServiceKey[Command[A]]): Behavior[Command[A]]

    To be used with WorkPullingProducerController.

    To be used with WorkPullingProducerController. It will register itself to the akka.actor.typed.receptionist.Receptionist with the given serviceKey, and the WorkPullingProducerController subscribes to the same key to find active workers.

  6. def apply[A](settings: Settings): Behavior[Command[A]]
  7. def apply[A](): Behavior[Command[A]]
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  10. def confirmed(): Confirmed

    Java API: the singleton instance of the Confirmed message.

    Java API: the singleton instance of the Confirmed message. When the message has been processed the consumer is supposed to send Confirmed back to the ConsumerController via the confirmTo in the Delivery message.

  11. def create[A](serviceKey: ServiceKey[Command[A]], settings: Settings): Behavior[Command[A]]

    Java API

  12. def create[A](serviceKey: ServiceKey[Command[A]]): Behavior[Command[A]]

    Java API: To be used with WorkPullingProducerController.

    Java API: To be used with WorkPullingProducerController. It will register itself to the akka.actor.typed.receptionist.Receptionist with the given serviceKey, and the WorkPullingProducerController subscribes to the same key to find active workers.

  13. def create[A](settings: Settings): Behavior[Command[A]]

    Java API

  14. def create[A](): Behavior[Command[A]]

    Java API

  15. def deliveryClass[A](): Class[Delivery[A]]

    Java API: The generic Class type for ConsumerController.Delivery that can be used when creating a messageAdapter for Class<Delivery<MessageType>>.

  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def serviceKeyClass[A]: Class[Command[A]]

    Java API: The generic Class type for ConsumerController.Command that can be used when creating a ServiceKey for Class<Command<MessageType>>.

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. case object Confirmed extends Confirmed with Product with Serializable

    When the message has been processed the consumer is supposed to send Confirmed back to the ConsumerController via the confirmTo in the Delivery message.

  31. object Delivery
  32. object SequencedMessage extends Serializable
  33. object Settings

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped