diff --git a/sylvilagus/scala/src/main/scala/com/meatballhat/sylvilagus/ch02/HelloWorldProducer.scala b/sylvilagus/scala/src/main/scala/com/meatballhat/sylvilagus/ch02/HelloWorldProducer.scala index d91adcf..5e4b4c0 100644 --- a/sylvilagus/scala/src/main/scala/com/meatballhat/sylvilagus/ch02/HelloWorldProducer.scala +++ b/sylvilagus/scala/src/main/scala/com/meatballhat/sylvilagus/ch02/HelloWorldProducer.scala @@ -1,18 +1,18 @@ import com.rabbitmq.client._ -object Producer extends App { +object HelloWorldProducer extends App { if (args.length < 1) { println("You must provide a message argument") } else { var messageBody = args(0) - var factory = new ConnectionFactory() - factory.setUri("amqp://guest:guest@localhost:5672") + var factory = new ConnectionFactory() + factory.setUri("amqp://guest:guest@localhost:5672") var connection = factory.newConnection() - var channel = connection.createChannel() + var channel = connection.createChannel() - channel.exchangeDeclare("hello-exchange", "direct", true) - channel.queueDeclare("hello-queue", true, false, false, null) + channel.exchangeDeclare("hello-exchange", "direct", true) + channel.queueDeclare("hello-queue", false, false, false, null) println("Publishing ", messageBody) channel.basicPublish("hello-exchange", "hola", null,