Skip to content

Commit 8473250

Browse files
migrate to vert.x 5.0.7 with vertx-jooq gradle subproject
- upgrade vertx from 4.5.25 to 5.0.7 - rebase vertx-grpc fork on upstream v5 with RoutingContext customization - convert vertx-jooq fork from maven to gradle subproject (15 modules) - add vertx-jooq-fork as git submodule from hiddenswitch/forks-jooq-vertx-5 - migrate executeBlocking from Handler<Promise> to Callable API - migrate eventually from Function to Supplier API - replace CompositeFuture.all with Future.all - replace io.vertx.core.logging with slf4j - replace PgPool/MySQLPool constructors with builder pattern - add shim io.vertx.core.logging Logger/LoggerFactory for compatibility - update vertx-grpc to v5 ServiceMethod API with protoc plugin2 - update smallrye-mutiny bindings to 4.0.0-beta0 for vertx 5 - remove mavenLocal from repositories - all 68 server tests passing
1 parent a130d8e commit 8473250

129 files changed

Lines changed: 4139 additions & 6208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "steamguardcli"]
1111
path = steamguardcli
1212
url = git@github.com:hiddenswitch/steamguard-cli.git
13+
[submodule "vertx-jooq-fork"]
14+
path = vertx-jooq-fork
15+
url = git@github.com:hiddenswitch/forks-jooq-vertx-5.git

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ subprojects {
205205
}
206206

207207
if (details.requested.group == 'org.infinispan') {
208-
details.useVersion infinispanVersion
208+
// Infinispan 15 merged -jakarta suffixed artifacts back to base names
209+
if (details.requested.name.endsWith('-jakarta')) {
210+
details.useTarget "${details.requested.group}:${details.requested.name.replace('-jakarta', '')}:${infinispanVersion}"
211+
} else {
212+
details.useVersion infinispanVersion
213+
}
209214
}
210215

211216
if (details.requested.group == 'org.objenesis') {

default-infinispan.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2022 Red Hat, Inc.
4+
~
5+
~ Red Hat licenses this file to you under the Apache License, version 2.0
6+
~ (the "License"); you may not use this file except in compliance with the
7+
~ License. You may obtain a copy of the License at:
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
~ License for the specific language governing permissions and limitations
15+
~ under the License.
16+
-->
17+
18+
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="urn:infinispan:config:14.0 http://www.infinispan.org/schemas/infinispan-config-14.0.xsd"
20+
xmlns="urn:infinispan:config:14.0">
21+
22+
<jgroups>
23+
<stack-file name="jgroups" path="tcp.xml"/>
24+
</jgroups>
25+
26+
<cache-container default-cache="distributed-cache">
27+
<transport stack="jgroups"/>
28+
<distributed-cache name="distributed-cache"/>
29+
<replicated-cache name="__vertx.subs"/>
30+
<replicated-cache name="__vertx.haInfo"/>
31+
<replicated-cache name="__vertx.nodeInfo"/>
32+
<distributed-cache-configuration name="__vertx.distributed.cache.configuration"/>
33+
</cache-container>
34+
35+
</infinispan>

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ classgraphVersion=4.8.184
77
jacksonVersion=2.19.0
88
jacksonDatabindVersion=2.19.0
99
jaegerVersion=1.8.1
10-
vertxVersion=4.5.25
10+
vertxVersion=5.0.7
1111
javaProtobufVersion=4.29.0
1212
junitVersion=5.14.3
1313
shadowPluginVersion=9.0.0-rc1
1414
guavaVersion=33.5.0-jre
1515
keycloakVersion=22.0.3
16-
micrometerVersion=1.10.2
16+
micrometerVersion=1.15.7
1717
jmhVersion=1.37
1818
testcontainersVersion=1.21.4
1919
postgresqlVersion=42.7.4
20-
nettyVersion=4.1.131.Final
20+
nettyVersion=4.2.9.Final
2121
grpcVersion=1.72.0
2222
protocVersion=4.29.0
2323
resteasyVersion=6.2.11.Final

settings.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,19 @@ include 'vertx-grpc:vertx-grpc-it'
3939
include 'vertx-grpc:vertx-grpc-server'
4040
include 'spellsource-graphql'
4141
include 'spellsource-heuristic-trainer'
42+
include 'vertx-jooq-fork:vertx-jooq-shared'
43+
include 'vertx-jooq-fork:vertx-jooq-shared-reactive'
44+
include 'vertx-jooq-fork:vertx-jooq-classic'
45+
include 'vertx-jooq-fork:vertx-jooq-classic-jdbc'
46+
include 'vertx-jooq-fork:vertx-jooq-classic-reactive'
47+
include 'vertx-jooq-fork:vertx-jooq-rx'
48+
include 'vertx-jooq-fork:vertx-jooq-rx-jdbc'
49+
include 'vertx-jooq-fork:vertx-jooq-rx-reactive'
50+
include 'vertx-jooq-fork:vertx-jooq-rx3'
51+
include 'vertx-jooq-fork:vertx-jooq-rx3-jdbc'
52+
include 'vertx-jooq-fork:vertx-jooq-rx3-reactive'
53+
include 'vertx-jooq-fork:vertx-jooq-mutiny'
54+
include 'vertx-jooq-fork:vertx-jooq-mutiny-jdbc'
55+
include 'vertx-jooq-fork:vertx-jooq-mutiny-reactive'
56+
include 'vertx-jooq-fork:vertx-jooq-generate'
4257

spellsource-common/src/main/java/io/vertx/await/Async.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33

44
import io.vertx.core.*;
5-
import io.vertx.core.impl.ContextInternal;
6-
import io.vertx.core.impl.VertxInternal;
5+
import io.vertx.core.internal.ContextInternal;
6+
import io.vertx.core.internal.VertxInternal;
77

88
import java.lang.ref.WeakReference;
99
import java.util.Objects;
@@ -68,7 +68,7 @@ public static <T> Future<T> vt(Vertx vertx, Callable<T> handler) {
6868
var finalRef = ref;
6969
vertxInternal.addCloseHook(prom -> {
7070
finalRef.clear();
71-
prom.complete(null);
71+
prom.succeed();
7272
});
7373
} else {
7474
context = ref.get();
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package io.vertx.core.logging;
2+
3+
/**
4+
* Shim for the removed {@code io.vertx.core.logging.Logger} class.
5+
* Bridges to SLF4J so that libraries compiled against Vert.x 4 logging still work at runtime.
6+
*/
7+
public class Logger {
8+
9+
private final org.slf4j.Logger delegate;
10+
11+
Logger(org.slf4j.Logger delegate) {
12+
this.delegate = delegate;
13+
}
14+
15+
public boolean isDebugEnabled() {
16+
return delegate.isDebugEnabled();
17+
}
18+
19+
public void debug(Object message, Object... params) {
20+
if (delegate.isDebugEnabled()) {
21+
delegate.debug(String.valueOf(message), params);
22+
}
23+
}
24+
25+
public void info(Object message, Object... params) {
26+
if (delegate.isInfoEnabled()) {
27+
delegate.info(String.valueOf(message), params);
28+
}
29+
}
30+
31+
public void warn(Object message, Object... params) {
32+
if (delegate.isWarnEnabled()) {
33+
delegate.warn(String.valueOf(message), params);
34+
}
35+
}
36+
37+
public void error(Object message, Object... params) {
38+
if (delegate.isErrorEnabled()) {
39+
delegate.error(String.valueOf(message), params);
40+
}
41+
}
42+
43+
public void trace(Object message, Object... params) {
44+
if (delegate.isTraceEnabled()) {
45+
delegate.trace(String.valueOf(message), params);
46+
}
47+
}
48+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package io.vertx.core.logging;
2+
3+
/**
4+
* Shim for the removed {@code io.vertx.core.logging.LoggerFactory} class.
5+
* Bridges to SLF4J so that libraries compiled against Vert.x 4 logging still work at runtime.
6+
*/
7+
public class LoggerFactory {
8+
9+
public static Logger getLogger(Class<?> clazz) {
10+
return new Logger(org.slf4j.LoggerFactory.getLogger(clazz));
11+
}
12+
13+
public static Logger getLogger(String name) {
14+
return new Logger(org.slf4j.LoggerFactory.getLogger(name));
15+
}
16+
}

spellsource-common/src/main/java/io/vertx/executeblocking/ExecuteBlocking.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import io.vertx.core.Future;
44
import io.vertx.core.Vertx;
5-
import io.vertx.core.impl.ContextInternal;
6-
import io.vertx.core.impl.future.PromiseInternal;
5+
import io.vertx.core.internal.ContextInternal;
6+
import io.vertx.core.internal.PromiseInternal;
77

88
import java.util.concurrent.Callable;
99
import java.util.concurrent.ThreadFactory;

spellsource-server/build.gradle

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
buildscript {
2-
ext {
3-
vertxJooqVersion = '6.5.5'
4-
}
52
repositories {
6-
mavenLocal()
73
mavenCentral()
84
}
95
dependencies {
10-
classpath "io.github.jklingsporn:vertx-jooq-generate:$vertxJooqVersion"
6+
classpath "org.jooq:jooq-codegen:3.17.3"
117
classpath "org.postgresql:postgresql:$postgresqlVersion"
12-
classpath "io.vertx:vertx-core:$vertxVersion"
138
}
149
}
1510

@@ -33,14 +28,16 @@ repositories {
3328

3429
evaluationDependsOn(':spellsource-containers')
3530

31+
configurations {
32+
jooqGenerator
33+
}
34+
3635
import com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer
3736
import com.bmuschko.gradle.docker.tasks.container.DockerRemoveContainer
3837
import com.bmuschko.gradle.docker.tasks.container.DockerStartContainer
3938
import com.bmuschko.gradle.docker.tasks.container.DockerStopContainer
4039
import com.bmuschko.gradle.docker.tasks.image.DockerPullImage
4140
import com.kobylynskyi.graphql.codegen.model.ApiInterfaceStrategy
42-
import io.github.jklingsporn.vertx.jooq.shared.postgres.JSONBToJsonObjectConverter
43-
import io.vertx.core.json.JsonObject
4441
import org.apache.tools.ant.taskdefs.condition.Os
4542
import org.jooq.codegen.GenerationTool
4643
import org.jooq.meta.jaxb.*
@@ -55,7 +52,7 @@ def jdbcUrl = "jdbc:postgresql://localhost:5432/$localDatabaseName"
5552
def jvmArgs = ['--enable-preview', '--add-opens', 'java.base/java.lang=ALL-UNNAMED', '-XX:+UseContainerSupport', '-XX:MaxRAMPercentage=80.0', '-XX:+UseG1GC', '-XX:MinHeapFreeRatio=10', '-XX:MaxHeapFreeRatio=20', '-XX:-ShrinkHeapInSteps', '-XX:G1PeriodicGCInterval=10000']
5653

5754
dependencies {
58-
compileOnly 'org.infinispan:infinispan-component-annotations:15.0.0.Dev01'
55+
compileOnly 'org.infinispan:infinispan-component-annotations:15.0.11.Final'
5956

6057
implementation project(':spellsource-common')
6158
implementation project(':spellsource-game')
@@ -110,7 +107,7 @@ dependencies {
110107
implementation group: "io.netty", name: "netty-resolver-dns-native-macos", version: nettyVersion, classifier: "osx-aarch_64"
111108
implementation 'org.jooq:jooq:3.17.3'
112109
implementation "io.vertx:vertx-pg-client:$vertxVersion"
113-
implementation("io.github.jklingsporn:vertx-jooq-classic-reactive:$vertxJooqVersion") {
110+
implementation(project(':vertx-jooq-fork:vertx-jooq-classic-reactive')) {
114111
exclude group: "io.vertx", module: '*'
115112
}
116113

@@ -156,6 +153,11 @@ dependencies {
156153
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.2'
157154

158155
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
156+
157+
jooqGenerator project(':vertx-jooq-fork:vertx-jooq-generate')
158+
jooqGenerator project(':vertx-jooq-fork:vertx-jooq-shared')
159+
jooqGenerator "org.postgresql:postgresql:$postgresqlVersion"
160+
jooqGenerator "io.vertx:vertx-core:$vertxVersion"
159161
}
160162

161163
javadoc {
@@ -302,8 +304,8 @@ tasks.register('jooqGenerate') {
302304
new SchemaMappingType().withInputSchema("hiddenswitch").withOutputSchema("hiddenswitch"))
303305
.withForcedTypes(
304306
new ForcedType()
305-
.withUserType(JsonObject.class.getName())
306-
.withConverter(JSONBToJsonObjectConverter.class.getName())
307+
.withUserType('io.vertx.core.json.JsonObject')
308+
.withConverter('io.github.jklingsporn.vertx.jooq.shared.postgres.JSONBToJsonObjectConverter')
307309
.withIncludeTypes("jsonb"))
308310
.withIncludeTables(true)
309311
.withIncludeRoutines(true)
@@ -326,6 +328,11 @@ tasks.register('jooqGenerate') {
326328
.withName('io.github.jklingsporn.vertx.jooq.generate.VertxGeneratorStrategy')))
327329

328330
doLast() {
331+
def cl = new URLClassLoader(
332+
configurations.jooqGenerator.files.collect { it.toURI().toURL() } as URL[],
333+
GenerationTool.classLoader
334+
)
335+
Thread.currentThread().setContextClassLoader(cl)
329336
GenerationTool.generate(configuration)
330337
exec {
331338
// dump the generated ddl to a file

0 commit comments

Comments
 (0)