Typed consistent hashing example (#30036)
Co-authored-by: Renato Cavalcanti <renato@cavalcanti.be>
This commit is contained in:
parent
55ec18962c
commit
fb432b3d8a
3 changed files with 154 additions and 2 deletions
|
|
@ -139,6 +139,13 @@ hash key. This makes the decision transparent for the sender.
|
|||
Consistent hashing delivers messages with the same hash to the same routee as long as the set of routees stays the same.
|
||||
When the set of routees changes, consistent hashing tries to make sure, but does not guarantee, that messages with the same hash are routed to the same routee.
|
||||
|
||||
|
||||
Scala
|
||||
: @@snip [RouterSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/RouterSpec.scala) { #consistent-hashing }
|
||||
|
||||
Java
|
||||
: @@snip [RouterTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/RouterTest.java) { #consistent-hashing }
|
||||
|
||||
See also @ref[Akka Cluster Sharding](cluster-sharding.md) which provides stable routing and rebalancing of the routee actors.
|
||||
|
||||
## Routers and performance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue