如何在集群启动时预启动实体?我已经找到了一种方法,但是我认为这不是正确的方法。它包括向每个节点上的分片区域发送StartEntity(entityId)消息。假设我有1000个实体要初始化。似乎表现不佳(由于每个节点都试图初始化远程实体,因此群集中的消息爆炸了!)>
val shardRegion: ActorRef[ShardingEnvelope[Command]] = sharding.init(Entity(HelloServiceEntity)(createBehavior = ctx => HelloWorldService())) Seq("S0", "S1").foreach { id => shardRegion ! StartEntity(id) }
有没有有效的方法来实现我想要的?我找不到有关它的官方帖子或文档。我做错了吗?
如何在集群启动时预启动实体?我已经找到了一种方法,但是我认为这不是正确的方法。它包括将StartEntity(entityId)消息发送到...