Browse Source

Update to latest Hexagon release (#7042)

* Fix error with URLs in JEE servers

* Clean up

* Avoid classpath URLs

* Fix template loading error

* Fix template loading error

* Chores

* Fix template loading error

* Delete MongoDB DB support

Storage support in Hexagon will be moved outside the Toolkit, and so, it will be left outside the benchmark.

* Fix runtime problem

* Update Hexagon version

* Make Jackson Blackbird module optional

* Add variation with Blackbird module enabled

* Upgrade Hexagon version

* Enable blackbird Jackson module by default

* Update dependencies

* Use Hexagon version 2.0.0-B1 (and a little cleanup)

* Use Hexagon version 2.0.0-B1 (and a little cleanup)

* Use Tomcat instead Resin to test JEE integration

* Remove unused environment variable

* Clean Tomcat dockerfile

* Minor improvements

* Minor improvements

* Update to release version

* Update to the latest Hexagon release
Juanjo Aguililla 3 years ago
parent
commit
42446aa987

+ 3 - 3
frameworks/Kotlin/hexagon/build.gradle

@@ -4,10 +4,10 @@ plugins {
 }
 }
 
 
 ext {
 ext {
-    gradleScripts = "https://raw.githubusercontent.com/hexagonkt/hexagon/2.0.0/gradle"
+    gradleScripts = "https://raw.githubusercontent.com/hexagonkt/hexagon/2.0.2/gradle"
 
 
-    hexagonVersion = "2.0.0"
-    hikariVersion = "5.0.0"
+    hexagonVersion = "2.0.2"
+    hikariVersion = "5.0.1"
     jettyVersion = "11.0.7"
     jettyVersion = "11.0.7"
     postgresqlVersion = "42.3.1"
     postgresqlVersion = "42.3.1"
     cache2kVersion = "2.4.1.Final"
     cache2kVersion = "2.4.1.Final"

+ 11 - 11
frameworks/Kotlin/hexagon/src/main/kotlin/Settings.kt

@@ -1,9 +1,9 @@
 package com.hexagonkt
 package com.hexagonkt
 
 
-import com.hexagonkt.core.Jvm.systemSetting
+import com.hexagonkt.core.Jvm.systemSettingOrNull
 
 
 data class Settings(
 data class Settings(
-    val bindPort: Int = systemSetting("bindPort") ?: 9090,
+    val bindPort: Int = systemSettingOrNull("bindPort") ?: 9090,
     val bindAddress: String = "0.0.0.0",
     val bindAddress: String = "0.0.0.0",
 
 
     val database: String = "hello_world",
     val database: String = "hello_world",
@@ -13,18 +13,18 @@ data class Settings(
     val databaseUsername: String = "benchmarkdbuser",
     val databaseUsername: String = "benchmarkdbuser",
     val databasePassword: String = "benchmarkdbpass",
     val databasePassword: String = "benchmarkdbpass",
 
 
-    val maximumPoolSize: Int = systemSetting("maximumPoolSize") ?: 96,
+    val maximumPoolSize: Int = systemSettingOrNull("maximumPoolSize") ?: 96,
 
 
-    val webEngine: String = systemSetting("WEBENGINE") ?: "jetty",
+    val webEngine: String = systemSettingOrNull("WEBENGINE") ?: "jetty",
 
 
-    val worldName: String = systemSetting("worldCollection") ?: "world",
-    val fortuneName: String = systemSetting("fortuneCollection") ?: "fortune",
-    val databaseName: String = systemSetting("database") ?: "hello_world",
-    val databaseDriver: String = systemSetting("databaseDriver") ?: "org.postgresql.Driver",
+    val worldName: String = systemSettingOrNull("worldCollection") ?: "world",
+    val fortuneName: String = systemSettingOrNull("fortuneCollection") ?: "fortune",
+    val databaseName: String = systemSettingOrNull("database") ?: "hello_world",
+    val databaseDriver: String = systemSettingOrNull("databaseDriver") ?: "org.postgresql.Driver",
 
 
-    val sendDateHeader: Boolean = systemSetting("sendDateHeader") ?: true,
-    val sendServerVersion: Boolean = systemSetting("sendServerVersion") ?: true,
-    val sendXPoweredBy: Boolean = systemSetting("sendXPoweredBy") ?: false,
+    val sendDateHeader: Boolean = systemSettingOrNull("sendDateHeader") ?: true,
+    val sendServerVersion: Boolean = systemSettingOrNull("sendServerVersion") ?: true,
+    val sendXPoweredBy: Boolean = systemSettingOrNull("sendXPoweredBy") ?: false,
 
 
     val worldRows: Int = 10_000,
     val worldRows: Int = 10_000,
     val textMessage: String = "Hello, World!",
     val textMessage: String = "Hello, World!",

+ 3 - 3
frameworks/Kotlin/hexagon/src/main/kotlin/store/BenchmarkSqlStore.kt

@@ -21,12 +21,12 @@ internal class BenchmarkSqlStore(engine: String, private val settings: Settings
     }
     }
 
 
     private val dataSource: HikariDataSource by lazy {
     private val dataSource: HikariDataSource by lazy {
-        val dbHost = Jvm.systemSetting("${engine.uppercase()}_DB_HOST") ?: "localhost"
-        val environment = Jvm.systemSetting(String::class, "BENCHMARK_ENV")?.lowercase()
+        val dbHost = Jvm.systemSettingOrNull("${engine.uppercase()}_DB_HOST") ?: "localhost"
+        val environment = Jvm.systemSettingOrNull(String::class, "BENCHMARK_ENV")?.lowercase()
         val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
         val poolSize = 8 + if (environment == "citrine") Jvm.cpuCount else Jvm.cpuCount * 2
         val config = HikariConfig().apply {
         val config = HikariConfig().apply {
             jdbcUrl = "jdbc:postgresql://$dbHost/${settings.databaseName}"
             jdbcUrl = "jdbc:postgresql://$dbHost/${settings.databaseName}"
-            maximumPoolSize = Jvm.systemSetting(Int::class, "maximumPoolSize") ?: poolSize
+            maximumPoolSize = Jvm.systemSettingOrNull(Int::class, "maximumPoolSize") ?: poolSize
             driverClassName = settings.databaseDriver
             driverClassName = settings.databaseDriver
             username = settings.databaseUsername
             username = settings.databaseUsername
             password = settings.databasePassword
             password = settings.databasePassword