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()) }) } }