diff --git a/frameworks/Java/jooby/conf/application.vertx.conf b/frameworks/Java/jooby/conf/application.vertx.conf
new file mode 100644
index 00000000000..d3a286c4b71
--- /dev/null
+++ b/frameworks/Java/jooby/conf/application.vertx.conf
@@ -0,0 +1,6 @@
+# Add/Override some properties to matches Vertx pg Driver properties
+db.database = ${db.databaseName}
+db.host = ${db.serverName}
+db.cachePreparedStatements = true
+db.preparedStatementCacheMaxSize = 1024
+db.pipeliningLimit = 256
diff --git a/frameworks/Java/jooby/jooby-pgclient.dockerfile b/frameworks/Java/jooby/jooby-pgclient.dockerfile
index 77eb7d3bea5..e5917ae2af5 100644
--- a/frameworks/Java/jooby/jooby-pgclient.dockerfile
+++ b/frameworks/Java/jooby/jooby-pgclient.dockerfile
@@ -4,8 +4,8 @@ COPY pom.xml pom.xml
COPY src src
COPY public public
COPY conf conf
-RUN mvn package -q -P netty
+RUN mvn package -q -P vertx
EXPOSE 8080
-CMD ["java", "-server", "-Xms2g", "-Xmx2g", "-XX:+UseNUMA", "-XX:+UseParallelGC", "--enable-native-access=ALL-UNNAMED", "--add-opens=java.base/java.lang=ALL-UNNAMED", "--sun-misc-unsafe-memory-access=allow", "-Dio.netty.disableHttpHeadersValidation=true", "-Dio.netty.buffer.checkBounds=false", "-Dio.netty.buffer.checkAccessible=false", "-Dio.netty.noUnsafe=false", "-Dio.netty.eventLoopGroup=single", "-cp", "target/jooby.jar", "com.techempower.ReactivePg"]
+CMD ["java", "-server", "-Xms2g", "-Xmx2g", "-XX:+UseNUMA", "-XX:+UseParallelGC", "--enable-native-access=ALL-UNNAMED", "--add-opens=java.base/java.lang=ALL-UNNAMED", "--sun-misc-unsafe-memory-access=allow", "-Dio.netty.disableHttpHeadersValidation=true", "-Dio.netty.buffer.checkBounds=false", "-Dio.netty.buffer.checkAccessible=false", "-Dio.netty.noUnsafe=false", "-Dio.netty.eventLoopGroup=single", "-Djava.lang.Integer.IntegerCache.high=10000", "-Dvertx.disableMetrics=true", "-Dvertx.disableContextTimings=true", "-cp", "target/jooby.jar", "com.techempower.ReactivePg", "vertx"]
diff --git a/frameworks/Java/jooby/pom.xml b/frameworks/Java/jooby/pom.xml
index 20c192196cf..1c86733ddc9 100644
--- a/frameworks/Java/jooby/pom.xml
+++ b/frameworks/Java/jooby/pom.xml
@@ -11,7 +11,7 @@
jooby
- 4.0.7
+ 4.0.9
2.0.2
42.7.7
UTF-8
@@ -44,10 +44,11 @@
${postgresql.version}
+
- io.vertx
- vertx-pg-client
- 5.0.1
+ io.jooby
+ jooby-vertx-pg-client
+ ${jooby.version}
@@ -205,6 +206,17 @@
+
+
+ vertx
+
+
+ io.jooby
+ jooby-vertx
+ ${jooby.version}
+
+
+
diff --git a/frameworks/Java/jooby/src/main/java/com/techempower/App.java b/frameworks/Java/jooby/src/main/java/com/techempower/App.java
index bd43f712c5c..fbc4bdb8164 100644
--- a/frameworks/Java/jooby/src/main/java/com/techempower/App.java
+++ b/frameworks/Java/jooby/src/main/java/com/techempower/App.java
@@ -27,7 +27,7 @@ public class App extends Jooby {
private static final String MESSAGE = "Hello, World!";
- private static final byte[] MESSAGE_BYTES = MESSAGE.getBytes(StandardCharsets.US_ASCII);
+ private static final byte[] MESSAGE_BYTES = MESSAGE.getBytes(StandardCharsets.UTF_8);
{
/** Database: */
diff --git a/frameworks/Java/jooby/src/main/java/com/techempower/PgClient.java b/frameworks/Java/jooby/src/main/java/com/techempower/PgClient.java
deleted file mode 100644
index 3bb393c8a3d..00000000000
--- a/frameworks/Java/jooby/src/main/java/com/techempower/PgClient.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package com.techempower;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.function.BiConsumer;
-
-import com.typesafe.config.Config;
-import io.jooby.SneakyThrows;
-import io.vertx.core.AsyncResult;
-import io.vertx.core.Future;
-import io.vertx.core.Handler;
-import io.vertx.core.Vertx;
-import io.vertx.core.VertxOptions;
-import io.vertx.pgclient.PgConnectOptions;
-import io.vertx.pgclient.PgConnection;
-import io.vertx.sqlclient.PreparedQuery;
-import io.vertx.sqlclient.PreparedStatement;
-import io.vertx.sqlclient.Row;
-import io.vertx.sqlclient.RowSet;
-import io.vertx.sqlclient.Tuple;
-import io.vertx.sqlclient.impl.SqlClientInternal;
-
-public class PgClient {
-
- static {
- // Should be all I/O processing for SQL responses
- System.setProperty("vertx.nettyIORatio", "100");
- }
-
- private static final String UPDATE_WORLD = "UPDATE world SET randomnumber=$1 WHERE id=$2";
- private static final String SELECT_WORLD = "SELECT id, randomnumber from WORLD where id=$1";
- private static final String SELECT_FORTUNE = "SELECT id, message from FORTUNE";
-
- private static class DbConnection {
- private SqlClientInternal queries;
- private PreparedQuery> SELECT_WORLD_QUERY;
- private PreparedQuery> SELECT_FORTUNE_QUERY;
- private PreparedQuery> UPDATE_WORLD_QUERY;
- private SqlClientInternal updates;
- @SuppressWarnings("unchecked")
- private PreparedQuery>[] AGGREGATED_UPDATE_WORLD_QUERY = new PreparedQuery[500];
- }
-
- public static class PgUpdate {
- private DbConnection connection;
-
- public PgUpdate(DbConnection connection) {
- this.connection = connection;
- }
-
- public void selectWorldForUpdate(int queries, BiConsumer>> consumer) {
- connection.queries.group(c -> {
- PreparedQuery> statement = c.preparedQuery(SELECT_WORLD);
- for (int i = 0; i < queries; i++) {
- consumer.accept(i, statement);
- }
- });
- }
-
- public void updateWorld(World[] worlds, Handler>> handler) {
- Arrays.sort(worlds);
- int len = worlds.length;
- if (0 < len && len <= connection.AGGREGATED_UPDATE_WORLD_QUERY.length) {
- List