Packages

final class KafkaClusterSharding extends Extension

API MAY CHANGE

Akka Extension to enable Akka Cluster External Sharding with Alpakka 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. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def messageExtractor[M](kafkaPartitions: Int): KafkaShardingMessageExtractor[M]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a akka.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 akka.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

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

    Java API

    Java API

    API MAY CHANGE

    Asynchronously return a akka.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 akka.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: FiniteDuration, settings: ConsumerSettings[_, _]): Future[KafkaShardingMessageExtractor[M]]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a akka.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 akka.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

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

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a akka.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 akka.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: (M) => String): KafkaShardingNoEnvelopeExtractor[M]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a akka.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 akka.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](topic: String, timeout: Duration, entityIdExtractor: Function[M, String], settings: ConsumerSettings[_, _]): CompletionStage[KafkaShardingNoEnvelopeExtractor[M]]

    Java API

    Java API

    API MAY CHANGE

    Asynchronously return a akka.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 akka.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: FiniteDuration, entityIdExtractor: (M) => String, settings: ConsumerSettings[_, _]): Future[KafkaShardingNoEnvelopeExtractor[M]]

    API MAY CHANGE

    API MAY CHANGE

    Asynchronously return a akka.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 akka.kafka.Subscription must contain the same number of partitions to ensure that entities are routed to the same Entity type.

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

    Java API

    Java API

    API MAY CHANGE

    Create an Alpakka 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 Akka cluster member.

    Returns an Akka typed akka.actor.typed.ActorRef. This must be converted to a classic actor before it can be passed to an Alpakka Kafka ConsumerSettings.

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

    API MAY CHANGE

    API MAY CHANGE

    Create an Alpakka 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 Akka cluster member.

    Returns an Akka typed akka.actor.typed.ActorRef. This must be converted to a classic actor before it can be passed to an Alpakka Kafka ConsumerSettings.

    import akka.actor.typed.scaladsl.adapter._
    val listenerClassicActorRef: akka.actor.ActorRef = listenerTypedActorRef.toClassic
    Annotations
    @ApiMayChange()
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

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

    (Since version 9)

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Ungrouped