From 0d7d6f641199967cdf113d903923258cefc1ee9b Mon Sep 17 00:00:00 2001 From: Christopher Batey Date: Fri, 24 Jan 2020 12:14:02 +0000 Subject: [PATCH] Add kafka to sharding example project (#28518) --- akka-docs/src/main/paradox/project/examples.md | 9 +++++++++ akka-docs/src/main/paradox/typed/cluster-sharding.md | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/akka-docs/src/main/paradox/project/examples.md b/akka-docs/src/main/paradox/project/examples.md index 7ac91834e8..966ffe5182 100644 --- a/akka-docs/src/main/paradox/project/examples.md +++ b/akka-docs/src/main/paradox/project/examples.md @@ -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. + + diff --git a/akka-docs/src/main/paradox/typed/cluster-sharding.md b/akka-docs/src/main/paradox/typed/cluster-sharding.md index abb26e7e89..3e1aa3e4d1 100644 --- a/akka-docs/src/main/paradox/typed/cluster-sharding.md +++ b/akka-docs/src/main/paradox/typed/cluster-sharding.md @@ -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