Browse Source

Upgrade http4k - readd Undertow implementation (#2993)

* upgrade http4k, re-add undertow.

* fix compilation
David Denton 7 years ago
parent
commit
0132b9f34a

+ 25 - 0
frameworks/Kotlin/http4k/benchmark_config.json

@@ -25,6 +25,31 @@
         "notes": "",
         "versus": "servlet"
       }
+    },
+    {
+      "undertow": {
+        "setup_file": "setup_undertow",
+        "orm": "Raw",
+        "database_os": "Linux",
+        "db_url": "/db",
+        "fortune_url": "/fortunes",
+        "query_url": "/queries?queries=",
+        "update_url": "/updates?queries=",
+        "database": "postgres",
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "port": 9000,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "framework": "http4k",
+        "language": "Kotlin",
+        "platform": "undertow",
+        "webserver": "None",
+        "os": "Linux",
+        "display_name": "http4k-undertow",
+        "notes": "",
+        "versus": "undertow"
+      }
     }
   ]
 }

+ 2 - 2
frameworks/Kotlin/http4k/build.gradle

@@ -1,6 +1,6 @@
 buildscript {
-    ext.kotlin_version = "1.1.4"
-    ext.http4k_version = "2.25.4"
+    ext.kotlin_version = "1.1.50"
+    ext.http4k_version = "2.31.3"
 
     repositories {
         mavenCentral()

+ 3 - 3
frameworks/Kotlin/http4k/core/src/main/kotlin/PlainTextRoute.kt

@@ -1,4 +1,4 @@
-import org.http4k.asByteBuffer
+
 import org.http4k.core.Body
 import org.http4k.core.ContentType.Companion.TEXT_PLAIN
 import org.http4k.core.Method.GET
@@ -9,9 +9,9 @@ import org.http4k.lens.binary
 import org.http4k.routing.bind
 
 object PlainTextRoute {
-    private val preAllocatedHelloWorldText = "Hello, World!".asByteBuffer()
+    private val preAllocatedHelloWorldText = "Hello, World!".byteInputStream()
 
     private val plainTextBody = Body.binary(TEXT_PLAIN).toLens()
 
-    operator fun invoke() = "/plaintext" bind GET to { Response(OK).with(plainTextBody of preAllocatedHelloWorldText) }
+    operator fun invoke() = "/plaintext" bind GET to { Response(OK).with(plainTextBody of Body(preAllocatedHelloWorldText)) }
 }

+ 1 - 1
frameworks/Kotlin/http4k/netty/src/main/kotlin/Http4kNettyServer.kt

@@ -2,5 +2,5 @@
 import org.http4k.server.Netty
 
 fun main(args: Array<String>) {
-    Http4kBenchmarkServer.start(Netty(9001))
+    Http4kBenchmarkServer.start(Netty(9000))
 }

+ 1 - 1
frameworks/Kotlin/http4k/undertow/src/main/kotlin/Http4kUndertowServer.kt

@@ -2,5 +2,5 @@
 import org.http4k.server.Undertow
 
 fun main(args: Array<String>) {
-    Http4kBenchmarkServer.start(Undertow(9002))
+    Http4kBenchmarkServer.start(Undertow(9000))
 }