ShardedDaemonProcess - numberOfInstances

In the akka-samples-cqrs-java the ShardedDaemonProcess is inited

      .init(....., settings.parallelism, ... )

and used later into ShardedDaemonProcessImpl

    val entityIds = (0 to numberOfInstances).map(_.toString)

but the tag in the ShoppingCart is created

        int n = Math.abs(entityContext.getEntityId().hashCode() % eventProcessorSettings.parallelism);
        String eventProcessorTag = eventProcessorSettings.tagPrefix + "-" + n;

So n could be from [0ā€¦eventProcessorSettings.parallelism)
while entityIds could be from [0ā€¦eventProcessorSettings.parallelism]

Should it be in ShardedDaemonProcessImpl

    val entityIds = (0 to numberOfInstances - 1).map(_.toString)
``` ?

Thanks for reporting @adrian.iacob!

This was fixed already and shipped in Akka 2.6.5 (released last Thursday).


1 Like