views:

217

answers:

3

There are so many different Actor model implementations for Java (and the JVM languages).

A lot of Actor libraries and frameworks have been implemented to permit Actor-style programming in Java (which doesn't have Actors built-in). I think the Actor model has big advantages, but the choices for Java are overwhelming!

Can someone post the most popular ones and offer some insight into which to use? Which ones have benchmarks for throughput in terms of messages passed per second?

+1  A: 

The Scala Actors is my best suggestion.

See http://www.scala-lang.org/node/242 for a short tutorial.

StudiousJoseph
Can Scala Actors be used in Java? (I still appreciate answers that use the JVM.)
Mr. White
Scala is a 100% JVM compatible language, so, Yes you can use it in Java.
StudiousJoseph
@StudiousJoseph I think you should say "use it with java". Eg it is faily easy to call Java from Scala and to call Scala from Java. But it it is kinda just another jar file: http://blog.lostlake.org/index.php?/archives/73-For-all-you-know,-its-just-another-Java-library.html
oluies
`@Brent:` Thanks for the clarification.
Mr. White
+4  A: 

This is a good article series. Also see this presentation.

Killim and Akka (scala) has the best performence (as I understand it). I would suggesst using Akka. Use akka as an frontend and call your java code if you dont want to do all of the coding in Scala. Scala and Akka has a very nice syntax and API. Akka has a Java API called "Active Objects". Note that there is a lot of things happening in Akka right now so the code base is moving fast.

Killim is java based but does compile time weawing.

Jetlang and FunctionalJava are options that does not do compile time weawing (??unsure), but is not as fast as Akka and Killim (no current data on this, but there are some old numbers in Jonas Boners and Viktor Klangs talk at Scala Days 2010 ).

Other options is using regular JMS (or some other MQ / PubSub). Also you could do your own simple intra JVM publication channels / workers. Or just use java util concurrent ExecutorService or com.google.common.util.concurrent

Other Scala based frameworks/libraries with Actor implementations are Stambecco, Lift and Scalaz.

oluies
Thanks for all the helpful links + explanation.
Mr. White
Also worth mentioning is that Akka has a Java API (Active Objects)
Viktor Klang
+2  A: 

We did a related study titled "Actor frameworks for the JVM platform: A Comparative Analysis", which was published last year and compares the syntax, semantics and performance of some of the JVM based Actor frameworks. It is available at http://osl.cs.uiuc.edu/docs/pppj09/paper.pdf. I hope you find it useful.

Rajesh Karmani