Why spring integration doc for akka exists only for 1.3.1 but not for next versions

百般思念 提交于 2019-12-19 07:07:20

问题


There is a link about the way to integrate AKKA and Spring. Or better say: "how to use Akka actors in spring environment".

http://doc.akka.io/docs/akka-modules/1.3.1/modules/spring.html

Actually there is modules folder http://doc.akka.io/docs/akka-modules/ that exists only for 1.3.1 version.

Does it mean that there is no integration for different than `1.3.1` version 
 with spring? 
Or it means that we should not use it (spring integration I mean)? 
Or we should do it in the same way as we do it for `1.3.1` version?

回答1:


The akka-spring module was not ported to the Akka 2.x series because it conflicts with the way actor systems work: with parental supervision only actors create other actors, which means that Spring—not being an actor—cannot create actors.

There is a new section in the documentation for the upcoming 2.2 release about how to use dependency injection while creating actors (see the docs). We are working on a more complete document describing the interplay between DI frameworks and Akka.




回答2:


As pointed out by Roland Kuhn, you keep the creation of child actors within their parents otherwise you lose the whole concept of supervision.

There is a useful post here: http://blog.nemccarthy.me/?p=272 on two approaches in 2.2 on wiring up Akka Actors with Spring using the IndirectActorProducer.

Prior to 2.2 you could also use the UntypedActorFactory to do a similar thing. The IndirectActorProducer is a much cleaner way to do this. You could also look at Creator: http://doc.akka.io/api/akka/2.2.0-RC1/index.html#akka.japi.Creator



来源:https://stackoverflow.com/questions/16948292/why-spring-integration-doc-for-akka-exists-only-for-1-3-1-but-not-for-next-versi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!