私はakkaとspringbootの新機能ですが、ほとんどの例でActorSystemにspringextentionを挿入していますが、私は以下のように試してみました。差異があるかどうかを知りたい、または今後問題が発生する可能性があります。springbootのActorSystem
取得ActorSystem以下のように:必要な場合
@Bean
public ActorSystem getActorSystem() {
// Create the actor system.
final Config settings = ConfigFactory.load();
return ActorSystem.create("my", settings);
}
が、その後すぐ下のように使用します。
ActorSystem system = context.getBean(ActorSystem.class);
ActorRef consumer = system.actorOf(Props.create(Consumer.class));