Packages

final class KafkaClusterSharding extends Extension

API MAY CHANGE

Apache Pekko Extension to enable Apache Pekko Cluster External Sharding with Apache Pekko Connector Kafka.

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

Instance Constructors

  1. new KafkaClusterSharding(system: ExtendedActorSystem)

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def messageExtractor[M](kafkaPartitions: Int): KafkaShardingMessageExtractor[M]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy is provided explicitly with kafkaPartitions.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  13. def messageExtractor[M](topic: String, timeout: Duration, settings: ConsumerSettings[_, _]): CompletionStage[KafkaShardingMessageExtractor[M]]

    Java API

    Java API

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy will be automatically determined by querying the Kafka cluster for the number of partitions of a user provided topic. Use the settings parameter to configure the Kafka Consumer connection required to retrieve the number of partitions. Each call to this method will result in a round trip to Kafka. This method should only be called once per entity type M, per local actor system.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  14. def messageExtractor[M](topic: String, timeout: FiniteDuration, settings: ConsumerSettings[_, _]): Future[KafkaShardingMessageExtractor[M]]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy will be automatically determined by querying the Kafka cluster for the number of partitions of a user provided topic. Use the settings parameter to configure the Kafka Consumer connection required to retrieve the number of partitions. Each call to this method will result in a round trip to Kafka. This method should only be called once per entity type M, per local actor system.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  15. def messageExtractorNoEnvelope[M](kafkaPartitions: Int, entityIdExtractor: Function[M, String]): KafkaShardingNoEnvelopeExtractor[M]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy is provided explicitly with kafkaPartitions.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  16. def messageExtractorNoEnvelope[M](kafkaPartitions: Int, entityIdExtractor: (M) => String): KafkaShardingNoEnvelopeExtractor[M]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy is provided explicitly with kafkaPartitions.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  17. def messageExtractorNoEnvelope[M](topic: String, timeout: Duration, entityIdExtractor: Function[M, String], settings: ConsumerSettings[_, _]): CompletionStage[KafkaShardingNoEnvelopeExtractor[M]]

    Java API

    Java API

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy will be automatically determined by querying the Kafka cluster for the number of partitions of a user provided topic. Use the settings parameter to configure the Kafka Consumer connection required to retrieve the number of partitions. Use the entityIdExtractor to pick a field from the Entity to use as the entity id for the hashing strategy. Each call to this method will result in a round trip to Kafka. This method should only be called once per entity type M, per local actor system.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  18. def messageExtractorNoEnvelope[M](topic: String, timeout: FiniteDuration, entityIdExtractor: (M) => String, settings: ConsumerSettings[_, _]): Future[KafkaShardingNoEnvelopeExtractor[M]]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a pekko.cluster.sharding.typed.ShardingMessageExtractor with a default hashing strategy based on Apache Kafka's org.apache.kafka.clients.producer.internals.DefaultPartitioner.

    The number of partitions to use with the hashing strategy will be automatically determined by querying the Kafka cluster for the number of partitions of a user provided topic. Use the settings parameter to configure the Kafka Consumer connection required to retrieve the number of partitions. Use the entityIdExtractor to pick a field from the Entity to use as the entity id for the hashing strategy. Each call to this method will result in a round trip to Kafka. This method should only be called once per entity type M, per local actor system.

    All topics used in a Consumer pekko.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

    Annotations
    @ApiMayChange()
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def rebalanceListener(typeKey: EntityTypeKey[_]): ActorRef[ConsumerRebalanceEvent]

    Java API

    Java API

    API MAY CHANGE

    Create an Apache Pekko Connector Kafka rebalance listener that handles TopicPartitionsAssigned events. The typeKey is used to create the ExternalShardAllocation client. When partitions are assigned to this consumer group member the rebalance listener will use the ExternalShardAllocation client to update the External Sharding strategy accordingly so that entities are (eventually) routed to the local Apache Pekko cluster member.

    Returns an Apache Pekko typed pekko.actor.typed.ActorRef. This must be converted to a classic actor before it can be passed to an Apache Pekko Connector Kafka ConsumerSettings.

    import org.apache.pekko
    import pekko.actor.typed.scaladsl.adapter._
    val listenerClassicActorRef: pekko.actor.ActorRef = listenerTypedActorRef.toClassic
    Annotations
    @ApiMayChange()
  23. def rebalanceListener(typeKey: EntityTypeKey[_]): ActorRef[ConsumerRebalanceEvent]

    API MAY CHANGE

    API MAY CHANGE

    Create an Apache Pekko Connector Kafka rebalance listener that handles TopicPartitionsAssigned events. The typeKey is used to create the ExternalShardAllocation client. When partitions are assigned to this consumer group member the rebalance listener will use the ExternalShardAllocation client to update the External Sharding strategy accordingly so that entities are (eventually) routed to the local Apache Pekko cluster member.

    Returns an Apache Pekko typed pekko.actor.typed.ActorRef. This must be converted to a classic actor before it can be passed to an Apache Pekko Connector Kafka ConsumerSettings.

    import org.apache.pekko
    import pekko.actor.typed.scaladsl.adapter._
    val listenerClassicActorRef: pekko.actor.ActorRef = listenerTypedActorRef.toClassic
    Annotations
    @ApiMayChange()
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  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()

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Ungrouped