print stacktrace
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-08-17 16:41:56 +02:00
parent af37f8d193
commit d9ca774f57
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -15,12 +15,15 @@ class DatabaseConsumer: Consumer, KoinComponent {
private val gson = Gson()
override fun handleConsumeOk(consumerTag: String?) {
}
override fun handleCancelOk(p0: String?) {
throw UnsupportedOperationException()
}
override fun handleRecoverOk(p0: String?) {
throw UnsupportedOperationException()
}
override fun handleCancel(p0: String?) {
throw UnsupportedOperationException()
}
@ -29,9 +32,18 @@ class DatabaseConsumer: Consumer, KoinComponent {
println("got shutdown signal")
}
override fun handleDelivery(consumerTag : String?, envelope : Envelope?, basicProperties : AMQP.BasicProperties?, body : ByteArray?) {
override fun handleDelivery(
consumerTag: String?,
envelope: Envelope?,
basicProperties: AMQP.BasicProperties?,
body: ByteArray?
) {
try {
val rawJson = body!!.toString(Charsets.UTF_8)
val apiObject = gson.fromJson(rawJson, ApiObject::class.java)
resultObjectService.addOne(apiObject)
} catch (e: Exception) {
println(e.stackTrace)
}
}
}