Declaring queue properly, but now it would appear we're blocking...

cat-town
Dan Buch 12 years ago
parent ce29df17cb
commit dda8e8cb85

@ -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,

Loading…
Cancel
Save