Compare commits

...

6 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
7f14051429 remove activation api
All checks were successful
continuous-integration/drone/push Build is passing
2020-05-22 01:53:04 +02:00
0f71773149 use java 11 2020-05-22 01:49:26 +02:00
3 changed files with 12 additions and 53 deletions

View File

@ -3,42 +3,11 @@ type: docker
name: default name: default
steps: 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 - name: build_application
image: openjdk:11-jdk image: openjdk:11-jdk
commands: commands:
- ./gradlew build -x test - ./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 - name: kaniko
image: banzaicloud/drone-kaniko image: banzaicloud/drone-kaniko
settings: settings:
@ -51,18 +20,3 @@ steps:
tags: tags:
- latest - latest
- ${DRONE_BUILD_NUMBER} - ${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

@ -12,8 +12,8 @@ buildscript {
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_11
} }
apply plugin: 'kotlin' apply plugin: 'kotlin'
@ -65,7 +65,7 @@ kotlin.experimental.coroutines = 'enable'
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "11"
} }
} }

View File

@ -6,7 +6,11 @@ import com.kmalbz.api.model.SampleObject
import com.kmalbz.database.service.IInputObjectService import com.kmalbz.database.service.IInputObjectService
import com.rabbitmq.client.BuiltinExchangeType import com.rabbitmq.client.BuiltinExchangeType
import com.rabbitmq.client.ConnectionFactory import com.rabbitmq.client.ConnectionFactory
import com.rabbitmq.client.MessageProperties
import com.typesafe.config.ConfigFactory 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.application.call
import io.ktor.config.HoconApplicationConfig import io.ktor.config.HoconApplicationConfig
import io.ktor.http.HttpStatusCode import io.ktor.http.HttpStatusCode
@ -30,7 +34,6 @@ import java.io.InputStream
import java.io.OutputStream import java.io.OutputStream
import java.time.LocalDate import java.time.LocalDate
import java.util.* import java.util.*
import javax.activation.MimetypesFileTypeMap
/** /**
* Input Service * Input Service
@ -57,8 +60,6 @@ class InputServiceServer {
val rabbitExchangeName = appConfig.property("ktor.mq.exchange").getString() val rabbitExchangeName = appConfig.property("ktor.mq.exchange").getString()
channel.exchangeDeclare(rabbitExchangeName, BuiltinExchangeType.FANOUT) channel.exchangeDeclare(rabbitExchangeName, BuiltinExchangeType.FANOUT)
val queueName = channel.queueDeclare().queue
channel.queueBind(queueName, rabbitExchangeName, "")
val gson = GsonBuilder().setPrettyPrinting().create() val gson = GsonBuilder().setPrettyPrinting().create()
@ -99,7 +100,11 @@ class InputServiceServer {
resultObjectService.addOne(currentApiObject) resultObjectService.addOne(currentApiObject)
} }
channel.basicPublish("",queueName, null, tag.toString().toByteArray()) connection.confirmChannel {
publish {
publishWithConfirm(OutboundMessage(rabbitExchangeName, "", MessageProperties.PERSISTENT_BASIC, tag.toString()))
}
}
call.respond(currentApiObject) call.respond(currentApiObject)
} }