Skip to content

Commit

Permalink
Update vertx to 4.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Dec 20, 2023
1 parent 4d07a91 commit 7e00564
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<wildfly-client-config.version>1.0.1.Final</wildfly-client-config.version>
<wildfly-elytron.version>2.2.2.Final</wildfly-elytron.version>
<jboss-threads.version>3.5.1.Final</jboss-threads.version>
<vertx.version>4.4.6</vertx.version>
<vertx.version>4.5.1</vertx.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
<httpasync.version>4.1.5</httpasync.version>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/resteasy-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include::_attributes.adoc[]
:httpspec: https://tools.ietf.org/html/rfc7231
:jsonpapi: https://javadoc.io/doc/jakarta.json/jakarta.json-api/2.1.2/jakarta.json
:injectapi: https://javadoc.io/static/jakarta.inject/jakarta.inject-api/2.0.1/jakarta.inject
:vertxapi: https://javadoc.io/static/io.vertx/vertx-core/4.4.6
:vertxapi: https://javadoc.io/static/io.vertx/vertx-core/4.5.1
:resteasy-reactive-api: https://javadoc.io/doc/io.quarkus.resteasy.reactive/resteasy-reactive/{quarkus-version}

Check warning on line 20 in docs/src/main/asciidoc/resteasy-reactive.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.CaseSensitiveTerms] Use 'RESTEasy' rather than 'resteasy'. Raw Output: {"message": "[Quarkus.CaseSensitiveTerms] Use 'RESTEasy' rather than 'resteasy'.", "location": {"path": "docs/src/main/asciidoc/resteasy-reactive.adoc", "range": {"start": {"line": 20, "column": 2}}}, "severity": "INFO"}

Check warning on line 20 in docs/src/main/asciidoc/resteasy-reactive.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'resteasy'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'resteasy'?", "location": {"path": "docs/src/main/asciidoc/resteasy-reactive.adoc", "range": {"start": {"line": 20, "column": 2}}}, "severity": "WARNING"}
:resteasy-reactive-common-api: https://javadoc.io/doc/io.quarkus.resteasy.reactive/resteasy-reactive-common/{quarkus-version}

Check warning on line 21 in docs/src/main/asciidoc/resteasy-reactive.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using 'because' or 'while' rather than 'as'.", "location": {"path": "docs/src/main/asciidoc/resteasy-reactive.adoc", "range": {"start": {"line": 21, "column": 7}}}, "severity": "INFO"}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import io.smallrye.common.vertx.VertxContext;
import io.smallrye.mutiny.Uni;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.EventLoopContext;
import io.vertx.core.impl.WorkerContext;
import io.vertx.mutiny.core.Context;
import io.vertx.mutiny.core.Vertx;

Expand Down Expand Up @@ -73,7 +71,7 @@ public String invokeFromIoThread(String s) {
service.sayHello(HelloRequest.newBuilder().setName(s).build())
.map(HelloReply::getMessage)
.invoke(() -> assertThat(Vertx.currentContext()).isNotNull().isEqualTo(context))
.invoke(() -> assertThat(Vertx.currentContext().getDelegate()).isInstanceOf(EventLoopContext.class))
.invoke(() -> assertThat(Vertx.currentContext().getDelegate().isEventLoopContext()).isTrue())
.subscribe().with(e::complete, e::fail);
});
}).await().atMost(Duration.ofSeconds(5));
Expand All @@ -86,9 +84,9 @@ public String invokeFromDuplicatedContext(String s) {
duplicate.runOnContext(x -> {
service.sayHello(HelloRequest.newBuilder().setName(s).build())
.map(HelloReply::getMessage)
.invoke(() -> assertThat(Vertx.currentContext().getDelegate())
.isNotInstanceOf(EventLoopContext.class).isNotInstanceOf(WorkerContext.class)
.isEqualTo(duplicate))
.invoke(() -> assertThat(Vertx.currentContext()).isNotNull().isEqualTo(duplicate))
.invoke(() -> assertThat(Vertx.currentContext().getDelegate().isEventLoopContext()).isFalse())
.invoke(() -> assertThat(Vertx.currentContext().getDelegate().isWorkerContext()).isFalse())
.subscribe().with(e::complete, e::fail);
});
}).await().atMost(Duration.ofSeconds(5));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.common.vertx.VertxContext;
import io.smallrye.mutiny.Uni;
import io.vertx.core.impl.EventLoopContext;
import io.vertx.core.impl.WorkerContext;
import io.vertx.mutiny.core.Context;
import io.vertx.mutiny.core.Vertx;

Expand Down Expand Up @@ -79,7 +77,7 @@ public String invokeFromIoThread(String s) {
service.sayHello(HelloRequest.newBuilder().setName(s).build())
.map(HelloReply::getMessage)
.invoke(() -> assertThat(Vertx.currentContext()).isNotNull().isEqualTo(context))
.invoke(() -> assertThat(Vertx.currentContext().getDelegate()).isInstanceOf(EventLoopContext.class))
.invoke(() -> assertThat(Vertx.currentContext().getDelegate().isEventLoopContext()).isTrue())
.map(r -> r + " " + Thread.currentThread().getName())
.subscribe().with(e::complete, e::fail);
});
Expand All @@ -93,9 +91,9 @@ public String invokeFromDuplicatedContext(String s) {
duplicate.runOnContext(x -> {
service.sayHello(HelloRequest.newBuilder().setName(s).build())
.map(HelloReply::getMessage)
.invoke(() -> assertThat(Vertx.currentContext().getDelegate())
.isNotInstanceOf(EventLoopContext.class).isNotInstanceOf(WorkerContext.class)
.isEqualTo(duplicate))
.invoke(() -> assertThat(Vertx.currentContext()).isNotNull().isEqualTo(duplicate))
.invoke(() -> assertThat(Vertx.currentContext().getDelegate().isEventLoopContext()).isFalse())
.invoke(() -> assertThat(Vertx.currentContext().getDelegate().isWorkerContext()).isFalse())
.map(r -> r + " " + Thread.currentThread().getName())
.subscribe().with(e::complete, e::fail);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.quarkus.runtime.LaunchMode;
import io.quarkus.runtime.ShutdownContext;
import io.vertx.core.Vertx;
import io.vertx.core.impl.EventLoopContext;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.VertxInternal;

public class InProcessGrpcServerBuilderProvider implements GrpcBuilderProvider<InProcessServerBuilder> {
Expand All @@ -35,7 +35,7 @@ public ServerBuilder<InProcessServerBuilder> createServerBuilder(Vertx vertx, Gr
// wrap with Vert.x context, so that the context interceptors work
VertxInternal vxi = (VertxInternal) vertx;
Executor delegate = vertx.nettyEventLoopGroup();
EventLoopContext context = vxi.createEventLoopContext();
ContextInternal context = vxi.createEventLoopContext();
Executor executor = command -> delegate.execute(() -> context.dispatch(command));
builder.executor(executor);
return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import io.quarkus.runtime.LaunchMode;
import io.quarkus.runtime.ShutdownContext;
import io.vertx.core.Vertx;
import io.vertx.core.impl.EventLoopContext;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.VertxInternal;

public class XdsGrpcServerBuilderProvider implements GrpcBuilderProvider<XdsServerBuilder> {
Expand All @@ -54,7 +54,7 @@ public ServerBuilder<XdsServerBuilder> createServerBuilder(Vertx vertx, GrpcServ
// wrap with Vert.x context, so that the context interceptors work
VertxInternal vxi = (VertxInternal) vertx;
Executor delegate = vertx.nettyEventLoopGroup();
EventLoopContext context = vxi.createEventLoopContext();
ContextInternal context = vxi.createEventLoopContext();
Executor executor = command -> delegate.execute(() -> context.dispatch(command));
builder.executor(executor);
// custom XDS interceptors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import io.vertx.core.http.*;
import io.vertx.core.http.impl.Http1xServerConnection;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.EventLoopContext;
import io.vertx.core.impl.Utils;
import io.vertx.core.impl.VertxInternal;
import io.vertx.core.net.SocketAddress;
Expand Down Expand Up @@ -1273,7 +1272,7 @@ public void initChannel(VirtualServerChannel ch) throws Exception {
.childHandler(new ChannelInitializer<VirtualChannel>() {
@Override
public void initChannel(VirtualChannel ch) throws Exception {
EventLoopContext context = vertx.createEventLoopContext();
ContextInternal context = vertx.createEventLoopContext();
VertxHandler<Http1xServerConnection> handler = VertxHandler.create(chctx -> {

Http1xServerConnection conn = new Http1xServerConnection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public void close(Promise<Void> promise) {
}

@Substitute
public MessageImpl createMessage(boolean send, String address, MultiMap headers, Object body, String codecName) {
public MessageImpl createMessage(boolean send, boolean isLocal, String address, MultiMap headers, Object body,
String codecName) {
throw new RuntimeException("Not Implemented");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import io.vertx.core.MultiMap;
import io.vertx.core.Promise;
import io.vertx.core.TimeoutStream;
import io.vertx.core.Timer;
import io.vertx.core.Verticle;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
Expand All @@ -60,6 +61,7 @@
import io.vertx.core.eventbus.EventBus;
import io.vertx.core.file.FileSystem;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientBuilder;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
Expand All @@ -69,6 +71,8 @@
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.http.RequestOptions;
import io.vertx.core.http.WebSocket;
import io.vertx.core.http.WebSocketClient;
import io.vertx.core.http.WebSocketClientOptions;
import io.vertx.core.http.WebSocketConnectOptions;
import io.vertx.core.http.WebsocketVersion;
import io.vertx.core.net.NetClient;
Expand Down Expand Up @@ -420,6 +424,16 @@ public HttpServer createHttpServer() {
return getDelegate().createHttpServer();
}

@Override
public WebSocketClient createWebSocketClient(WebSocketClientOptions webSocketClientOptions) {
return getDelegate().createWebSocketClient(webSocketClientOptions);
}

@Override
public HttpClientBuilder httpClientBuilder() {
return getDelegate().httpClientBuilder();
}

@Override
public HttpClient createHttpClient(HttpClientOptions httpClientOptions) {
return new LazyHttpClient(new Supplier<HttpClient>() {
Expand Down Expand Up @@ -480,6 +494,11 @@ public SharedData sharedData() {
return getDelegate().sharedData();
}

@Override
public Timer timer(long l, TimeUnit timeUnit) {
return getDelegate().timer(l, timeUnit);
}

@Override
public long setTimer(long l, Handler<Long> handler) {
return getDelegate().setTimer(l, handler);
Expand Down Expand Up @@ -850,10 +869,25 @@ public Future<WebSocket> webSocketAbs(String url, MultiMap headers, WebsocketVer
}

@Override
public Future<Void> updateSSLOptions(SSLOptions options) {
public Future<Boolean> updateSSLOptions(SSLOptions options) {
return getDelegate().updateSSLOptions(options);
}

@Override
public void updateSSLOptions(SSLOptions options, Handler<AsyncResult<Boolean>> handler) {
getDelegate().updateSSLOptions(options, handler);
}

@Override
public Future<Boolean> updateSSLOptions(SSLOptions sslOptions, boolean b) {
return getDelegate().updateSSLOptions(sslOptions, b);
}

@Override
public void updateSSLOptions(SSLOptions options, boolean force, Handler<AsyncResult<Boolean>> handler) {
getDelegate().updateSSLOptions(options, force, handler);
}

@Override
public HttpClient connectionHandler(Handler<HttpConnection> handler) {
return getDelegate().connectionHandler(handler);
Expand Down
2 changes: 1 addition & 1 deletion independent-projects/resteasy-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<version.surefire.plugin>3.2.3</version.surefire.plugin>
<mutiny.version>2.5.1</mutiny.version>
<smallrye-common.version>2.1.2</smallrye-common.version>
<vertx.version>4.4.6</vertx.version>
<vertx.version>4.5.1</vertx.version>
<rest-assured.version>5.4.0</rest-assured.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<jackson-bom.version>2.16.0</jackson-bom.version>
Expand Down

0 comments on commit 7e00564

Please sign in to comment.