|
|
@ -5,7 +5,8 @@ import com.rabbitmq.client._
|
|
|
|
object HelloWorldProducer extends App {
|
|
|
|
object HelloWorldProducer extends App {
|
|
|
|
if (args.length < 1) {
|
|
|
|
if (args.length < 1) {
|
|
|
|
println("You must provide a message argument")
|
|
|
|
println("You must provide a message argument")
|
|
|
|
} else {
|
|
|
|
exit
|
|
|
|
|
|
|
|
}
|
|
|
|
var messageBody = args(0)
|
|
|
|
var messageBody = args(0)
|
|
|
|
|
|
|
|
|
|
|
|
var factory = new ConnectionFactory()
|
|
|
|
var factory = new ConnectionFactory()
|
|
|
@ -20,5 +21,4 @@ object HelloWorldProducer extends App {
|
|
|
|
channel.basicPublish("hello-exchange", "hola", null, messageBody.getBytes())
|
|
|
|
channel.basicPublish("hello-exchange", "hola", null, messageBody.getBytes())
|
|
|
|
|
|
|
|
|
|
|
|
connection.close()
|
|
|
|
connection.close()
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|