Package akka.routing
Class ConsistentHashingRouter
- java.lang.Object
-
- akka.routing.ConsistentHashingRouter
-
public class ConsistentHashingRouter extends java.lang.Object
If you don't define thehashMapping
when constructing theConsistentHashingRouter
the messages need to implement this interface to define what data to use for the consistent hash key. Note that it's not the hash, but the data to be hashed.If returning an
Array[Byte]
or String it will be used as is, otherwise the configuredSerializer
will be applied to the returned data.If messages can't implement this interface themselves, it's possible to wrap the messages in
ConsistentHashingRouter.ConsistentHashableEnvelope
, or useConsistentHashingRouter.ConsistentHashableEnvelope
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ConsistentHashingRouter.ConsistentHashable
static class
ConsistentHashingRouter.ConsistentHashableEnvelope
static class
ConsistentHashingRouter.ConsistentHashableEnvelope$
static interface
ConsistentHashingRouter.ConsistentHashMapper
static class
ConsistentHashingRouter.emptyConsistentHashMapping$
-
Constructor Summary
Constructors Constructor Description ConsistentHashingRouter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static scala.PartialFunction<java.lang.Object,java.lang.Object>
hashMappingAdapter(ConsistentHashingRouter.ConsistentHashMapper mapper)
-
-
-
Method Detail
-
hashMappingAdapter
public static scala.PartialFunction<java.lang.Object,java.lang.Object> hashMappingAdapter(ConsistentHashingRouter.ConsistentHashMapper mapper)
-
-