Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Do you think that using akka actors in front of transactional service beans, is a good idea ?

Actors are waked up by a facade used by a client application, and actor use a message to handle right service call.

Is it a good practice ?

This article (http://honeysoft.wordpress.com/2012/08/05/akka-actor-dependency-injection-using-spring/) is talking about using spring beans with akka actors. But I could not see the gain to use actors in front of (singleton) spring beans.

share|improve this question

migrated from codereview.stackexchange.com Feb 11 '13 at 22:30

This question came from our site for peer programmer code reviews.

add comment

1 Answer 1

up vote 2 down vote accepted

Since the Akka docs state that Actors should not block (on IO, sockets, ...) unless it's is really unavoidable, it sounds like there might be little value in having actors wrap transactional services, of which I'm assuming the majority will be backed by transactional databases.

There might be other reasons to using Actors of course (the remoting, durable inboxes, clustering, ...)

share|improve this answer
    
I am not sure I understand the problem entirely. Do you mean that an actor would have to wait for a transaction to be complete and that this behaviour would contradict the normal semantics of an actor (asynchronous message passing, non-blocking)? –  Giorgio Feb 12 '13 at 11:29
    
Yes, that's why i think that using actors in front of spring is not a good idea. Maybe that's why there is not (yet) akka-spring 2.1. I can see in most website, that used spring with akka, is in fact a little redundant. –  Zenithar Feb 12 '13 at 13:22
    
@Girogio: yes, that's how I understood it. It's not using Actors in front of Spring services that is a bad idea as such, but using Actors that do blocking operations (of which most Transactional services that do database access are). You could definitely use Actors calling Spring based services that don't do blocking operations without problems. –  Christophe Vanfleteren Feb 13 '13 at 9:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.