Compare commits

..

4 Commits

Author SHA1 Message Date
e699b878e0 async publish
All checks were successful
continuous-integration/drone/push Build is passing
2020-05-22 03:57:24 +02:00
ffed92fe39 fuck you jetbrains
All checks were successful
continuous-integration/drone/push Build is passing
2020-05-22 03:30:37 +02:00
c61620753b do not use cache 2020-05-22 03:30:12 +02:00
63f7865f7c do not declare queue
Some checks failed
continuous-integration/drone/push Build is failing
2020-05-22 03:26:39 +02:00
2 changed files with 9 additions and 49 deletions

View File

@ -3,42 +3,11 @@ type: docker
name: default
steps:
- name: restore-cache-with-filesystem
image: meltwater/drone-cache
settings:
backend: "filesystem"
restore: true
cache_key: "{{ .Repo.Name }}"
archive_format: "gzip"
filesystem_cache_root: "/tmp/cache"
mount:
- 'build'
- '.gradle'
volumes:
- name: cache
path: /tmp/cache
- name: build_application
image: openjdk:11-jdk
commands:
- ./gradlew build -x test
- name: rebuild-cache-with-filesystem
image: meltwater/drone-cache:dev
pull: true
settings:
backend: "filesystem"
rebuild: true
cache_key: "{{ .Repo.Name }}"
archive_format: "gzip"
filesystem_cache_root: "/tmp/cache"
mount:
- 'build'
- '.gradle'
volumes:
- name: cache
path: /tmp/cache
- name: kaniko
image: banzaicloud/drone-kaniko
settings:
@ -51,18 +20,3 @@ steps:
tags:
- latest
- ${DRONE_BUILD_NUMBER}
- name: send telegram notification
image: appleboy/drone-telegram
settings:
token:
from_secret: TELEGRAM_TOKEN
to:
from_secret: TELEGRAM_TO_ID
when:
status: [ failure ]
volumes:
- name: cache
host:
path: "/tmp/cache"

View File

@ -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
@ -56,8 +60,6 @@ class InputServiceServer {
val rabbitExchangeName = appConfig.property("ktor.mq.exchange").getString()
channel.exchangeDeclare(rabbitExchangeName, BuiltinExchangeType.FANOUT)
val queueName = channel.queueDeclare().queue
channel.queueBind(queueName, rabbitExchangeName, "")
val gson = GsonBuilder().setPrettyPrinting().create()
@ -98,7 +100,11 @@ class InputServiceServer {
resultObjectService.addOne(currentApiObject)
}
channel.basicPublish("",queueName, null, tag.toString().toByteArray())
connection.confirmChannel {
publish {
publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag.toString()))
}
}
call.respond(currentApiObject)
}