do not declare queue
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-05-22 03:25:12 +02:00
parent 5a644573e5
commit 857498d86e
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -35,8 +35,6 @@ class Glue {
val outputChannel = outputConnection.createChannel() val outputChannel = outputConnection.createChannel()
outputChannel.exchangeDeclare(mqOutputExchange, BuiltinExchangeType.FANOUT) outputChannel.exchangeDeclare(mqOutputExchange, BuiltinExchangeType.FANOUT)
val outputQueueName = outputChannel.queueDeclare().queue
outputChannel.queueBind(outputQueueName, mqOutputExchange, "")
GlobalScope.launch(Dispatchers.Default) { GlobalScope.launch(Dispatchers.Default) {
inputConnection.channel { inputConnection.channel {
@ -45,7 +43,7 @@ class Glue {
val rawJson = String(it.body) val rawJson = String(it.body)
val probability = Random.nextDouble(0.0,1.0) val probability = Random.nextDouble(0.0,1.0)
val outputObject = OutputModel(tag=rawJson, probability=probability) val outputObject = OutputModel(tag=rawJson, probability=probability)
outputChannel.basicPublish("",outputQueueName, null, gson.toJson(outputObject).toByteArray()) outputChannel.basicPublish(mqOutputExchange,"", null, gson.toJson(outputObject).toByteArray())
}) })
} }
} }