From 857498d86e511b72406233928ea65770f4b887b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Fri, 22 May 2020 03:25:12 +0200 Subject: [PATCH] do not declare queue --- src/main/kotlin/worker/Glue.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/kotlin/worker/Glue.kt b/src/main/kotlin/worker/Glue.kt index 69149e2..cc066b5 100644 --- a/src/main/kotlin/worker/Glue.kt +++ b/src/main/kotlin/worker/Glue.kt @@ -35,8 +35,6 @@ class Glue { val outputChannel = outputConnection.createChannel() outputChannel.exchangeDeclare(mqOutputExchange, BuiltinExchangeType.FANOUT) - val outputQueueName = outputChannel.queueDeclare().queue - outputChannel.queueBind(outputQueueName, mqOutputExchange, "") GlobalScope.launch(Dispatchers.Default) { inputConnection.channel { @@ -45,7 +43,7 @@ class Glue { val rawJson = String(it.body) val probability = Random.nextDouble(0.0,1.0) val outputObject = OutputModel(tag=rawJson, probability=probability) - outputChannel.basicPublish("",outputQueueName, null, gson.toJson(outputObject).toByteArray()) + outputChannel.basicPublish(mqOutputExchange,"", null, gson.toJson(outputObject).toByteArray()) }) } }