diff --git a/src/api/route/InputServiceServer.kt b/src/api/route/InputServiceServer.kt index e626c07..047ae4f 100644 --- a/src/api/route/InputServiceServer.kt +++ b/src/api/route/InputServiceServer.kt @@ -6,7 +6,11 @@ import com.kmalbz.api.model.SampleObject import com.kmalbz.database.service.IInputObjectService import com.rabbitmq.client.BuiltinExchangeType import com.rabbitmq.client.ConnectionFactory +import com.rabbitmq.client.MessageProperties import com.typesafe.config.ConfigFactory +import com.viartemev.thewhiterabbit.channel.confirmChannel +import com.viartemev.thewhiterabbit.channel.publish +import com.viartemev.thewhiterabbit.publisher.OutboundMessage import io.ktor.application.call import io.ktor.config.HoconApplicationConfig import io.ktor.http.HttpStatusCode @@ -96,7 +100,11 @@ class InputServiceServer { resultObjectService.addOne(currentApiObject) } - channel.basicPublish(rabbitExchangeName,"" , null, tag.toString().toByteArray()) + connection.confirmChannel { + publish { + publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag.toString())) + } + } call.respond(currentApiObject) }