Skip to content

Commit 16485af

Browse files
authored
http4k. Upgrade to new version and introduce Jetty 11 test variants (#8667)
* Added Jetty11 files * Upgrade HTTP4k to new version and introduce jetty 11 variants * Fix compile :)
1 parent bbdb621 commit 16485af

File tree

15 files changed

+204
-6
lines changed

15 files changed

+204
-6
lines changed

frameworks/Kotlin/http4k/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ The tests were run with:
1616
- Plaintext: http://localhost:9000/plaintext
1717

1818
## Supported backends (w/ Postgres client)
19-
- SunHttp/SunHttpLoom (default - bundled with core module - zero dependencies) (+ SunHttpLoom w/GraalVM)
19+
- SunHttp/SunHttpLoom (default - bundled with core module - zero dependencies) (+ SunHttpLoom w/GraalVM)
2020
- Apache (5)
2121
- Apache4 (+ w/GraalVM)
2222
- Helidon (+ w/GraalVM)
2323
- KtorCIO
2424
- KtorNetty
2525
- Jetty/JettyLoom
26+
- Jetty/JettyLoom (v11)
2627
- Netty
2728
- Ratpack
2829
- Undertow

frameworks/Kotlin/http4k/benchmark_config.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,72 @@
264264
"notes": "https://http4k.org",
265265
"versus": "jetty"
266266
},
267+
"jetty11": {
268+
"orm": "Raw",
269+
"database_os": "Linux",
270+
"cached_query_url": "/cached?queries=",
271+
"db_url": "/db",
272+
"json_url": "/json",
273+
"fortune_url": "/fortunes",
274+
"plaintext_url": "/plaintext",
275+
"query_url": "/queries?queries=",
276+
"update_url": "/updates?queries=",
277+
"database": "Postgres",
278+
"port": 9000,
279+
"approach": "Realistic",
280+
"classification": "Micro",
281+
"framework": "http4k",
282+
"language": "Kotlin",
283+
"platform": "jetty11",
284+
"webserver": "None",
285+
"os": "Linux",
286+
"notes": "https://http4k.org",
287+
"versus": "jetty"
288+
},
289+
"jetty11loom-jdbc": {
290+
"orm": "Raw",
291+
"database_os": "Linux",
292+
"cached_query_url": "/cached?queries=",
293+
"db_url": "/db",
294+
"json_url": "/json",
295+
"fortune_url": "/fortunes",
296+
"plaintext_url": "/plaintext",
297+
"query_url": "/queries?queries=",
298+
"update_url": "/updates?queries=",
299+
"database": "Postgres",
300+
"port": 9000,
301+
"approach": "Realistic",
302+
"classification": "Micro",
303+
"framework": "http4k",
304+
"language": "Kotlin",
305+
"platform": "jetty11-loom-jdbc",
306+
"webserver": "None",
307+
"os": "Linux",
308+
"notes": "https://http4k.org",
309+
"versus": "jetty11"
310+
},
311+
"jetty11loom-pgclient": {
312+
"orm": "Raw",
313+
"database_os": "Linux",
314+
"cached_query_url": "/cached?queries=",
315+
"db_url": "/db",
316+
"json_url": "/json",
317+
"fortune_url": "/fortunes",
318+
"plaintext_url": "/plaintext",
319+
"query_url": "/queries?queries=",
320+
"update_url": "/updates?queries=",
321+
"database": "Postgres",
322+
"port": 9000,
323+
"approach": "Realistic",
324+
"classification": "Micro",
325+
"framework": "http4k",
326+
"language": "Kotlin",
327+
"platform": "jetty11-loom-pgclient",
328+
"webserver": "None",
329+
"os": "Linux",
330+
"notes": "https://http4k.org",
331+
"versus": "jetty11"
332+
},
267333
"ktorcio": {
268334
"orm": "Raw",
269335
"database_os": "Linux",

frameworks/Kotlin/http4k/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22
import org.gradle.api.JavaVersion.*
33
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4+
import org.jetbrains.kotlin.js.translate.context.Namer.kotlin
45

56
plugins {
6-
kotlin("jvm") version "1.9.20"
7+
kotlin("jvm") version "1.9.22"
78
application
89
}
910

frameworks/Kotlin/http4k/config.toml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,60 @@ platform = "jetty-loom-pgclient"
161161
webserver = "None"
162162
versus = "jetty"
163163

164+
[jetty11]
165+
urls.cached_query = "/cached?queries="
166+
urls.db = "/db"
167+
urls.fortune = "/fortunes"
168+
urls.json = "/json"
169+
urls.plaintext = "/plaintext"
170+
urls.query = "/queries?queries="
171+
urls.update = "/updates?queries="
172+
approach = "Realistic"
173+
classification = "Micro"
174+
database = "Postgres"
175+
database_os = "Linux"
176+
os = "Linux"
177+
orm = "Raw"
178+
platform = "jetty11"
179+
webserver = "None"
180+
versus = "jetty"
181+
182+
[jetty11loom-jdbc]
183+
urls.cached_query = "/cached?queries="
184+
urls.db = "/db"
185+
urls.fortune = "/fortunes"
186+
urls.json = "/json"
187+
urls.plaintext = "/plaintext"
188+
urls.query = "/queries?queries="
189+
urls.update = "/updates?queries="
190+
approach = "Realistic"
191+
classification = "Micro"
192+
database = "Postgres"
193+
database_os = "Linux"
194+
os = "Linux"
195+
orm = "Raw"
196+
platform = "jetty-loom11-jdbc"
197+
webserver = "None"
198+
versus = "jetty11"
199+
200+
[jetty11loom-pgclient]
201+
urls.cached_query = "/cached?queries="
202+
urls.db = "/db"
203+
urls.fortune = "/fortunes"
204+
urls.json = "/json"
205+
urls.plaintext = "/plaintext"
206+
urls.query = "/queries?queries="
207+
urls.update = "/updates?queries="
208+
approach = "Realistic"
209+
classification = "Micro"
210+
database = "Postgres"
211+
database_os = "Linux"
212+
os = "Linux"
213+
orm = "Raw"
214+
platform = "jetty11-loom-pgclient"
215+
webserver = "None"
216+
versus = "jetty11"
217+
164218
[helidon-jdbc]
165219
urls.cached_query = "/cached?queries="
166220
urls.db = "/db"

frameworks/Kotlin/http4k/core/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ plugins {
44
}
55

66
dependencies {
7-
api(platform("org.http4k:http4k-bom:5.10.2.0"))
8-
api("org.jetbrains.kotlin:kotlin-stdlib:1.9.20")
9-
api("org.jetbrains.kotlin:kotlin-reflect:1.9.20")
7+
api(platform("org.http4k:http4k-bom:5.12.0.0"))
8+
api("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
9+
api("org.jetbrains.kotlin:kotlin-reflect:1.9.22")
1010
api("org.http4k:http4k-core")
1111
api("org.http4k:http4k-format-argo")
1212
api("org.http4k:http4k-template-rocker")
1313
api("org.apache.commons:commons-lang3:3.12.0")
1414
api("org.cache2k:cache2k-core:2.6.1.Final")
1515

16-
compileOnly("com.fizzed:rocker-compiler:1.3.0")
16+
compileOnly("com.fizzed:rocker-compiler:1.4.0")
1717
}
1818

1919
rocker {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM gradle:8.4.0-jdk21
2+
USER root
3+
WORKDIR /http4k
4+
COPY build.gradle.kts build.gradle.kts
5+
COPY settings.gradle.kts settings.gradle.kts
6+
COPY core core
7+
COPY core-jdbc core-jdbc
8+
COPY core-pgclient core-pgclient
9+
COPY jetty11 jetty11
10+
RUN gradle --quiet --no-daemon jetty11:shadowJar
11+
12+
EXPOSE 9000
13+
14+
CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AlwaysPreTouch", "-jar", "jetty11/build/libs/http4k-benchmark.jar"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM gradle:8.4.0-jdk21
2+
USER root
3+
WORKDIR /http4k
4+
COPY build.gradle.kts build.gradle.kts
5+
COPY settings.gradle.kts settings.gradle.kts
6+
COPY core core
7+
COPY core-jdbc core-jdbc
8+
COPY jetty11loom-jdbc jetty11loom-jdbc
9+
RUN gradle --quiet --no-daemon jetty11loom-jdbc:shadowJar
10+
11+
EXPOSE 9000
12+
13+
CMD ["java", "-server", "-XX:+UseNUMA", "--enable-preview", "-XX:+UseParallelGC", "-XX:+AlwaysPreTouch", "-jar", "jetty11loom-jdbc/build/libs/http4k-benchmark.jar"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM gradle:8.4.0-jdk21
2+
USER root
3+
WORKDIR /http4k
4+
COPY build.gradle.kts build.gradle.kts
5+
COPY settings.gradle.kts settings.gradle.kts
6+
COPY core core
7+
COPY core-pgclient core-pgclient
8+
COPY jetty11loom-pgclient jetty11loom-pgclient
9+
RUN gradle --quiet --no-daemon jetty11loom-pgclient:shadowJar
10+
11+
EXPOSE 9000
12+
13+
CMD ["java", "-server", "-XX:+UseNUMA", "--enable-preview", "-XX:+UseParallelGC", "-XX:+AlwaysPreTouch", "-jar", "jetty11loom-pgclient/build/libs/http4k-benchmark.jar"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
application.mainClass.set("Http4kJettyServerKt")
2+
3+
dependencies {
4+
api(project(":core-jdbc"))
5+
api("org.http4k:http4k-server-jetty11")
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import org.http4k.server.Jetty11
2+
3+
fun main() {
4+
Http4kBenchmarkServer(PostgresDatabase(), false).start(Jetty11(9000))
5+
}

0 commit comments

Comments
 (0)