title: Akka sharded cluster with multiple message IDs
body: <p>I'm using Akka's cluster sharding like this:</p>
  
  <pre><code>val deviceOperations = ClusterSharding(system).start(
    typeName = DeviceOperations.shardName,
    entryProps = Some(DeviceOperations.props(notification, profile, dataDecoders)),
    idExtractor = DeviceOperations.idExtractor,
    shardResolver = DeviceOperations.shardResolver)
  </code></pre>
  
  <p>The idExtractor and shardResolver are setup to extract an ID from a message and route a message to an actor in the cluster with a matching ID.</p>
  
  <pre><code>val idExtractor: ShardRegion.IdExtractor = {
    case ParentDeviceRegister(deviceId, registerProps) ⇒ (deviceId.toString, DeviceRegister(registerProps))
    ...
  }
  val shardResolver: ShardRegion.ShardResolver = {
    case ParentDeviceRegister(deviceId, _) ⇒ s"${deviceId.hashCode() % 10}"
    ...
  }
  </code></pre>
  
  <p>This should route all incoming messages with the same IDs to the same actor in the cluster. Unfortunately, half of the messages originating from the device use one unique ID and the rest of the messages use a different unique ID. Both unique IDs belong to the same device, and I want to route both sets of messages to the same actor. What is the best way to route these messages to the same corresponding actor in the cluster?</p>
  
  <p>I've thought about some type of key value store for looking up a common unique ID from the two separate unique IDs, but I would rather not introduce a single point of failure. The look-up would also have to be done for each message, which seems less than ideal.</p>
  
  <p>It would be great to be able to assign multiple identities to each actor in the cluster so that the coordinator could handle it.</p>
  
  <h2>Update</h2>
  
  <p>I think I have a plan... </p>
  
  <p>I'm going to select one of the IDs to be the primary ID. I'll use a secondary actor system to forward messages containing the secondary ID to the primary actor system. A secondary actor will store a device's Primary ID and use the primary ID to forward messages to the primary actor system.</p>
  
  <p>The secondary actor will not know the primary ID initially, but it can request the primary ID directly from the device when it receives the first message. The secondary actor will then store the Primary ID and route future messages to the primary device actor system using the stored primary ID. </p>
  
  <p>Other messages containing the primary ID will be directly sent to the primary actor system without the need for routing through the secondary actor system.</p>