Hi Paul, I've successfully written an email actor with Akka and
RabbitMQ.
In summary it works like this : A client actor class constructs an
object which contains the SINGLE email's details eg from, to, bcc,
message text etc, converts that to JSON using Google GSON library[1]
and puts it on to a a durable Rabbitmq[1]. I chose JSON so any future
client can grab the data from the queue.
Using Akka microkernal to host an actor which is monitoring the
RabbitMQ using AMQP, it deserializes the message and tries to send the
email. If the email can't be sent, or the actor blows up, the message
remains on the queue and will be retried. If you turn everything off,
the durable queue retains a copy of the emails, and the actors will
continue processing the next available message from the queue on
restart.
Multiple emails are sent via sending multiple JSON messages onto the
queue, allowing Akka to spin up more threads all by itself. You can
then have multiple email actors on multiple machines, put the queue on
another machine, so scaling out your app.
There is a bit more involved than I describe, eg multiple queues for
redundancies, retries for the email sending etc.
In the system I'm developing, I'm currently using 7 RabbitMQs queues
and 7 Akka Microkernals, with about 10 actors. So far as the system is
in a live test with 20 users, but will scale up to 10k users. I have
so far, had 0 faults with Akka. The only faults have been my code
bugs, or requirements s misunderstandings/changes.
In my scenario, AKKA really just works. So thanks to Jonas and all the
contributors to Akka !
A plug for Jonas: Jonas is running some AKKA courses in London. I'm
going to the May one.
http://skillsmatter.com/course/java-jee/jonas-boner-akka-scalability-fault-tolerance-concurrency-remoting-actors-stm
[1]
http://code.google.com/p/google-gson/
[2]
http://www.rabbitmq.com/