This commit is contained in:
parent
5a644573e5
commit
857498d86e
@ -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())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user