jboner/akka-modules — pull request #1 by freelas (2011-10-28 13:20:01+00:00)
Title: (suggestion of) changes in ProducerActor and ProducerParameters

Here at work we have to deal with this not queued messages ...

// FIXME: If channel is not available, messages should be queued back into the actor mailbox and actor should only react on 'Start'

not using the producer actor. using another actor who knows what to do (could send a error message, store and try to send again later when the channel is ok, ..., ..., ... )

ActorRef errorCallbackActor = Actors.actorOf(ErrorCallbackActor.class).start();

ProducerParameters producerParameters = new ProducerParameters(exchangeParameters, "producerActor", channelParameters, errorCallbackActor);

try to send again:

class PocChannelCallbackActor extends UntypedActor {
public void onReceive(Object message) throws Exception {
if (Started.getInstance().getClass().isAssignableFrom(message.getClass())) {
//producer.tell(not queued message rescued from errorCallbackActor )

we also updated the amqp client (2.6.1) to suppor high availability

AMQP.ExchangeParameters exchangeParameters = new AMQP.ExchangeParameters("poc.exchange", Topic.getInstance(), activeDeclaration, new scala.collection.immutable.HashMap().$plus(new Tuple2("x-ha-policy", "all")));