Skip to content

Commit

Permalink
Fix spring project
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Artemyev committed Mar 5, 2019
1 parent 08e8cfe commit d3cf7d4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
15 changes: 15 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ buildscript {
classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.7"
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.2.0.BUILD-SNAPSHOT"
classpath "org.jetbrains.kotlin:kotlin-allopen:1.3.21"
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.2"
}
}

Expand Down Expand Up @@ -109,6 +110,7 @@ configure(rootProject) {

project('the-white-rabbit-ktor-example') {
apply plugin: 'application'
mainClassName = "io.ktor.server.netty.EngineMain"

repositories {
mavenLocal()
Expand Down Expand Up @@ -167,6 +169,19 @@ project('the-white-rabbit-spring-boot-example') {
}

project('the-white-rabbit-vertx-example') {
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "application"

mainClassName = 'io.vertx.core.Launcher'
def mainVerticleName = 'com.viartemev.the_white_rabbit_vertx_example.App'

shadowJar {
classifier = 'fat'
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}

dependencies {
compile rootProject
compile "io.vertx:vertx-lang-kotlin:$vertx_version"
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kotlin.code.style=official
kotlin.code.style=official
spring-framework.version = 5.2.0.BUILD-SNAPSHOT
15 changes: 15 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
pluginManagement {
repositories {
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'https://repo.spring.io/milestone' }
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if(requested.id.id == 'org.springframework.boot') {
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
}
}
}
}

rootProject.name = 'the-white-rabbit'

include('benchmarks')
Expand Down
2 changes: 1 addition & 1 deletion the-white-rabbit-ktor-example/src/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun Application.module(testing: Boolean = false) {
get("/pull") {
connection.channel {
consume("test_queue") {
consumeWithConfirm({ call.respond(String(it.body)) })
consumeMessageWithConfirm({ call.respond(String(it.body)) })
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Handlers(private val connection: Connection) {
var message = "default_value"
connection.channel {
consume("test_queue", 1) {
consumeWithConfirm({
consumeMessageWithConfirm({
println("Got a message!")
message = String(it.body)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class App : CoroutineVerticle() {
suspend fun pull(ctx: RoutingContext) {
connection.channel {
consume("test_queue", 1) {
consumeWithConfirm({ ctx.response().setStatusCode(200).end(json { obj("message" to String(it.body)).encode() }) })
consumeMessageWithConfirm({ ctx.response().setStatusCode(200).end(json { obj("message" to String(it.body)).encode() }) })
}
}
}
Expand Down

0 comments on commit d3cf7d4

Please sign in to comment.