Tuesday, May 29, 2012

Akk and Camel and AMQP

So now we have Akka+Camel - let's introduce an AMQP component (so we can talk to an AMQP broker i.e. RabbitMQ).

Add the following line to your build.sbt:
libraryDependencies += "com.bluelock" % "camel-spring-amqp" % "1.1.0"
From the sbt command console type 'reload' then 'update' and you will be ready to connect Akka to Rabbit via Camel.

It may help to know that you MUST provide a queue name when creating a Consumer. This means it doesn't support server assigned queue names. So consumers have to generate their own unique queue names when implementing pub-sub - a bit of an inconvenience if you have many subscribers. It may also help to know that the above library uses the following defaults when it creates Exchanges:
boolean durable = false;
boolean exclusive = false;
boolean autodelete = true;

No comments: