<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,21 +1,33 @@
 package eu.getintheloop.example.rabbit
 
-import _root_.com.rabbitmq.client.{ConnectionFactory,ConnectionParameters}
-import _root_.net.liftweb.amqp.{ExampleSerializedAMQPDispatcher,AMQPAddListener,AMQPMessage}
+import _root_.com.rabbitmq.client.{ConnectionFactory,ConnectionParameters,Channel}
+import _root_.net.liftweb.amqp.{AMQPDispatcher,AMQPAddListener,AMQPMessage,SerializedConsumer}
 import _root_.scala.actors._
 
-object BasicStringListener {
+class DemonstrationSerializedAMQPDispatcher[T](queueName: String, factory: ConnectionFactory, host: String, port: Int) extends AMQPDispatcher[T](factory, host, port) {
+  override def configure(channel: Channel) {
+    // Get the ticket.
+    val ticket = channel.accessRequest(&quot;/data&quot;)
+    // Set up the exchange and queue
+    channel.exchangeDeclare(ticket, &quot;mult&quot;, &quot;fanout&quot;)
+    channel.queueDeclare(ticket, queueName)
+    channel.queueBind(ticket, queueName, &quot;mult&quot;, &quot;example.*&quot;)
+    // Use the short version of the basicConsume method for convenience.
+    channel.basicConsume(ticket, queueName, false, new SerializedConsumer(channel, this))
+  }
+}
+
+class BasicStringListener(queueName: String) {
   val params = new ConnectionParameters
   params.setUsername(&quot;guest&quot;)
   params.setPassword(&quot;guest&quot;)
   params.setVirtualHost(&quot;/&quot;)
   params.setRequestedHeartbeat(0)
-
+  
   val factory = new ConnectionFactory(params)
-  // thor.local is a machine on your network with rabbitmq listening on port 5672
-  val amqp = new ExampleSerializedAMQPDispatcher[String](factory, &quot;localhost&quot;, 5672)
+  val amqp = new DemonstrationSerializedAMQPDispatcher[String](queueName, factory, &quot;xmpiemacbookpro&quot;, 5672)
   amqp.start
-
+  
   // Example Listener that just prints the String it receives.
   class StringListener extends Actor {
     def act = {
@@ -28,3 +40,4 @@ object BasicStringListener {
   stringListener.start
   amqp ! AMQPAddListener(stringListener)
 }
+</diff>
      <filename>client/src/main/scala/eu/getintheloop/example/rabbit/BasicStringListener.scala</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ object BasicStringSender {
   // Create a new instance of the string sender.
   // This sender will send messages to the &quot;mult&quot; exchange with a 
   // routing key of &quot;routeroute&quot;
-  val amqp = new StringAMQPSender(factory, &quot;localhost&quot;, 5672, &quot;mult&quot;, &quot;routeroute&quot;)
+  val amqp = new StringAMQPSender(factory, &quot;xmpiemacbookpro&quot;, 5672, &quot;mult&quot;, &quot;example.demo&quot;)
   amqp.start
   
   /**</diff>
      <filename>server/src/main/scala/eu/getintheloop/example/rabbit/BasicStringSender.scala</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>055374065f798405d0632f3d2c925f979ee4fa5b</id>
    </parent>
  </parents>
  <author>
    <name>Timothy Perrett</name>
    <email>hello@timperrett.com</email>
  </author>
  <url>http://github.com/timperrett/rabbitmq-scala-tutorial/commit/1d6929d7bb788eebc9a0699a56f8fd443e48a3b5</url>
  <id>1d6929d7bb788eebc9a0699a56f8fd443e48a3b5</id>
  <committed-date>2009-05-22T04:39:00-07:00</committed-date>
  <authored-date>2009-05-22T04:39:00-07:00</authored-date>
  <message>Updated working code</message>
  <tree>ad4bcce3a580fa4d3b9a684c6a1e96eda0287001</tree>
  <committer>
    <name>Timothy Perrett</name>
    <email>hello@timperrett.com</email>
  </committer>
</commit>
