Getting rid of a silly else
block
This commit is contained in:
parent
dc1d9d5b0c
commit
04c57cc71f
@ -5,20 +5,20 @@ import com.rabbitmq.client._
|
||||
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 connection = factory.newConnection()
|
||||
var channel = connection.createChannel()
|
||||
|
||||
channel.exchangeDeclare("hello-exchange", "direct", true)
|
||||
channel.queueDeclare("hello-queue", false, false, false, null)
|
||||
|
||||
printf("Publishing '%s'\n", messageBody)
|
||||
channel.basicPublish("hello-exchange", "hola", null, messageBody.getBytes())
|
||||
|
||||
connection.close()
|
||||
exit
|
||||
}
|
||||
var messageBody = args(0)
|
||||
|
||||
var factory = new ConnectionFactory()
|
||||
factory.setUri("amqp://guest:guest@localhost:5672")
|
||||
var connection = factory.newConnection()
|
||||
var channel = connection.createChannel()
|
||||
|
||||
channel.exchangeDeclare("hello-exchange", "direct", true)
|
||||
channel.queueDeclare("hello-queue", false, false, false, null)
|
||||
|
||||
printf("Publishing '%s'\n", messageBody)
|
||||
channel.basicPublish("hello-exchange", "hola", null, messageBody.getBytes())
|
||||
|
||||
connection.close()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user