Interface ShardRegion.MessageExtractor

  • All Known Implementing Classes:
    ShardRegion.HashCodeMessageExtractor
    Enclosing class:
    ShardRegion

    public static interface ShardRegion.MessageExtractor
    Java API: Interface of functions to extract entity id, shard id, and the message to send to the entity from an incoming message.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String entityId​(java.lang.Object message)
      Extract the entity id from an incoming message.
      java.lang.Object entityMessage​(java.lang.Object message)
      Extract the message to send to the entity from an incoming message.
      java.lang.String shardId​(java.lang.Object message)
      Extract the shard id from an incoming message.
    • Method Detail

      • entityId

        java.lang.String entityId​(java.lang.Object message)
        Extract the entity id from an incoming message. If null is returned the message will be unhandled, i.e. posted as Unhandled messages on the event stream
      • entityMessage

        java.lang.Object entityMessage​(java.lang.Object message)
        Extract the message to send to the entity from an incoming message. Note that the extracted message does not have to be the same as the incoming message to support wrapping in message envelope that is unwrapped before sending to the entity actor.
      • shardId

        java.lang.String shardId​(java.lang.Object message)
        Extract the shard id from an incoming message. Only messages that passed the entityId(java.lang.Object) function will be used as input to this function.