Add kafka to sharding example project (#28518)

This commit is contained in:
Christopher Batey 2020-01-24 12:14:02 +00:00 committed by Johan Andrén
parent 029a2a8460
commit 0d7d6f6411
2 changed files with 15 additions and 0 deletions

View file

@ -85,3 +85,12 @@ This sample illustrates how to form an Akka Cluster with Akka Bootstrap when run
@extref[Distributed workers example project](samples:akka-samples-distributed-workers-scala)
This project demonstrates the work pulling pattern using Akka Cluster.
## Kafka to Cluster Sharding
@extref[Kafka to Cluster Sharding example project](samples:akka-samples-kafka-to-sharding)
This project demonstrates how to use the External Shard Allocation strategy to co-locate the consumption of Kafka
partitions with the shard that processes the messages.

View file

@ -194,6 +194,12 @@ The communication from the client to the shard allocation strategy is via @ref[D
It uses a single `LWWMap` that can support 10s of thousands of shards. Later versions could use multiple keys to
support a greater number of shards.
#### Example project for external allocation strategy
@extref[Kafka to Cluster Sharding](samples:akka-samples-kafka-to-sharding)
is an example project that can be downloaded, and with instructions of how to run, that demonstrates how to use
external sharding to co-locate Kafka partition consumption with shards.
### Custom shard allocation
An optional custom shard allocation strategy can be passed into the optional parameter when initializing an entity type