This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new d3e1a5b3cd09 CAMEL-23647: Upgrade to Vert.x 5.2.1 (#27825)
d3e1a5b3cd09 is described below
commit d3e1a5b3cd092e5b011325bedade910b334ec886
Author: James Netherton <[email protected]>
AuthorDate: Thu Oct 15 06:48:31 2026 +0100
CAMEL-23647: Upgrade to Vert.x 5.2.1 (#27825)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
.../integration/WatsonxAiWebSocketStreamingIT.java | 4 +-
.../camel-knative/camel-knative-http/pom.xml | 2 +-
.../knative/http/KnativeHttpProducer.java | 3 +-
.../component/knative/http/KnativeHttpServer.java | 6 +--
.../platform/http/main/MainHttpServer.java | 4 +-
.../http/vertx/VertxPlatformHttpRouter.java | 29 ++++++++-----
.../vertx/VertxPlatformHttpAuthenticationTest.java | 40 ++++--------------
.../vertx/http/TestVertxMetricsFactory.java | 34 +++++++++++++++
.../vertx/http/VertxHttpCustomVertxTest.java | 2 -
.../component/vertx/http/VertxHttpTestSupport.java | 4 +-
.../io.vertx.core.spi.VertxServiceProvider | 1 +
.../websocket/VertxWebsocketClientConsumer.java | 8 ++--
.../vertx/websocket/VertxWebsocketConsumer.java | 3 +-
.../vertx/websocket/VertxWebsocketEndpoint.java | 21 +++++++++-
.../vertx/websocket/VertxWebsocketHelper.java | 10 +++++
.../vertx/websocket/TestVertxMetricsFactory.java | 34 +++++++++++++++
.../vertx/websocket/VertxWebSocketEventTest.java | 2 +-
.../vertx/websocket/VertxWebSocketTestSupport.java | 49 +++++++++++++++++++---
.../VertxWebsocketComponentConfigurationTest.java | 2 -
.../VertxWebsocketExternalServerTest.java | 2 +-
.../VertxWebsocketHandshakeHeadersTest.java | 4 +-
.../vertx/websocket/VertxWebsocketSSLTest.java | 9 +++-
.../vertx/websocket/VertxWebsocketTest.java | 31 ++++++++++----
.../io.vertx.core.spi.VertxServiceProvider | 1 +
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 37 ++++++++++++++++
dsl/camel-componentdsl/pom.xml | 7 ++++
dsl/camel-endpointdsl/pom.xml | 7 ++++
parent/pom.xml | 2 +-
28 files changed, 274 insertions(+), 84 deletions(-)
diff --git
a/components/camel-ibm/camel-ibm-watsonx-ai/src/test/java/org/apache/camel/component/ibm/watsonx/ai/integration/WatsonxAiWebSocketStreamingIT.java
b/components/camel-ibm/camel-ibm-watsonx-ai/src/test/java/org/apache/camel/component/ibm/watsonx/ai/integration/WatsonxAiWebSocketStreamingIT.java
index 33b1c42a1b23..1ccdef29a700 100644
---
a/components/camel-ibm/camel-ibm-watsonx-ai/src/test/java/org/apache/camel/component/ibm/watsonx/ai/integration/WatsonxAiWebSocketStreamingIT.java
+++
b/components/camel-ibm/camel-ibm-watsonx-ai/src/test/java/org/apache/camel/component/ibm/watsonx/ai/integration/WatsonxAiWebSocketStreamingIT.java
@@ -70,6 +70,8 @@ public class WatsonxAiWebSocketStreamingIT extends
WatsonxAiTestSupport {
@RegisterExtension
AvailablePortFinder.Port port = AvailablePortFinder.find();
private Vertx vertx;
+ // kept until the end of the test, as a Vert.x WebSocket client that is
garbage collected closes its WebSockets
+ private WebSocketClient client;
@AfterEach
void tearDown() {
@@ -227,7 +229,7 @@ public class WatsonxAiWebSocketStreamingIT extends
WatsonxAiTestSupport {
private WebSocket openWebSocketConnection(String host, int port, String
path, Consumer<String> handler)
throws Exception {
vertx = Vertx.vertx();
- WebSocketClient client = vertx.createWebSocketClient();
+ client = vertx.createWebSocketClient();
CompletableFuture<WebSocket> future = client.connect(port, host, path)
.toCompletionStage()
.toCompletableFuture();
diff --git a/components/camel-knative/camel-knative-http/pom.xml
b/components/camel-knative/camel-knative-http/pom.xml
index 0a8d1113c782..76c7942880df 100644
--- a/components/camel-knative/camel-knative-http/pom.xml
+++ b/components/camel-knative/camel-knative-http/pom.xml
@@ -58,7 +58,7 @@
</dependency>
<dependency>
<groupId>io.vertx</groupId>
- <artifactId>vertx-codegen</artifactId>
+ <artifactId>vertx-codegen-api</artifactId>
<version>${vertx-version}</version>
<scope>provided</scope>
</dependency>
diff --git
a/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
b/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
index c894f89471ed..7568c522c618 100644
---
a/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
+++
b/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
@@ -26,7 +26,6 @@ import io.vertx.core.http.HttpHeaders;
import io.vertx.ext.web.client.HttpResponse;
import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.client.WebClientOptions;
-import io.vertx.ext.web.client.impl.WebClientBase;
import org.apache.camel.AsyncCallback;
import org.apache.camel.CamelException;
import org.apache.camel.Endpoint;
@@ -184,7 +183,7 @@ public class KnativeHttpProducer extends
DefaultAsyncProducer {
if (clientOptions instanceof KnativeOidcClientOptions
oidcClientOptions) {
if (oidcClientOptions.isOidcEnabled()) {
- ((WebClientBase) this.client).addInterceptor(new
KnativeOidcInterceptor(oidcClientOptions));
+ this.client.addInterceptor(new
KnativeOidcInterceptor(oidcClientOptions));
}
}
}
diff --git
a/components/camel-knative/camel-knative-http/src/test/java/org/apache/camel/component/knative/http/KnativeHttpServer.java
b/components/camel-knative/camel-knative-http/src/test/java/org/apache/camel/component/knative/http/KnativeHttpServer.java
index 56ef4829d94d..0e11cecbc4bf 100644
---
a/components/camel-knative/camel-knative-http/src/test/java/org/apache/camel/component/knative/http/KnativeHttpServer.java
+++
b/components/camel-knative/camel-knative-http/src/test/java/org/apache/camel/component/knative/http/KnativeHttpServer.java
@@ -159,7 +159,7 @@ public class KnativeHttpServer extends ServiceSupport {
CompletableFuture.runAsync(
() -> {
CountDownLatch latch = new CountDownLatch(1);
- server.requestHandler(router).listen(port, host, result ->
{
+ server.requestHandler(router).listen(port,
host).onComplete(result -> {
try {
if (result.failed()) {
LOGGER.warn("Failed to start Vert.x HttpServer
on {}:{}, reason: {}",
@@ -196,7 +196,7 @@ public class KnativeHttpServer extends ServiceSupport {
// remove the platform-http component
context.removeComponent(PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME);
- server.close(result -> {
+ server.close().onComplete(result -> {
try {
if (result.failed()) {
LOGGER.warn("Failed to close Vert.x
HttpServer reason: {}",
@@ -228,7 +228,7 @@ public class KnativeHttpServer extends ServiceSupport {
() -> {
CountDownLatch latch = new CountDownLatch(1);
- vertx.close(result -> {
+ vertx.close().onComplete(result -> {
try {
if (result.failed()) {
LOGGER.warn("Failed to close Vert.x
reason: {}",
diff --git
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServer.java
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServer.java
index dd77c5c6d364..799a733de68b 100644
---
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServer.java
+++
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServer.java
@@ -22,7 +22,7 @@ import java.io.IOException;
import java.io.InputStream;
import io.vertx.core.Handler;
-import io.vertx.core.http.impl.MimeMapping;
+import io.vertx.core.http.MimeMapping;
import io.vertx.ext.web.Route;
import io.vertx.ext.web.RoutingContext;
import org.apache.camel.CamelContext;
@@ -295,7 +295,7 @@ public class MainHttpServer extends ServiceSupport
implements CamelContextAware,
}
}
if (is != null) {
- String mime = MimeMapping.getMimeTypeForFilename(u);
+ String mime = MimeMapping.mimeTypeForFilename(u);
if (mime != null) {
ctx.response().putHeader("content-type", mime);
}
diff --git
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
index 9dcd5081df3a..1c7033483347 100644
---
a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
+++
b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java
@@ -198,6 +198,21 @@ public class VertxPlatformHttpRouter implements Router {
return delegate.postWithRegex(s);
}
+ @Override
+ public Route query() {
+ return delegate.query();
+ }
+
+ @Override
+ public Route query(String s) {
+ return delegate.query(s);
+ }
+
+ @Override
+ public Route queryWithRegex(String s) {
+ return delegate.queryWithRegex(s);
+ }
+
@Override
public Route delete() {
return delegate.delete();
@@ -269,19 +284,13 @@ public class VertxPlatformHttpRouter implements Router {
}
@Override
- @Deprecated(since = "4.23")
- public Route mountSubRouter(String mountPoint, Router subRouter) {
- if (mountPoint.endsWith("*")) {
- throw new IllegalArgumentException("Don't include * when mounting
a sub router");
- }
-
- return route(mountPoint + "*")
- .subRouter(subRouter);
+ public Router errorHandler(int i, Handler<RoutingContext> handler) {
+ return delegate.errorHandler(i, handler);
}
@Override
- public Router errorHandler(int i, Handler<RoutingContext> handler) {
- return delegate.errorHandler(i, handler);
+ public Router uncaughtErrorHandler(Handler<RoutingContext> handler) {
+ return delegate.uncaughtErrorHandler(handler);
}
@Override
diff --git
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpAuthenticationTest.java
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpAuthenticationTest.java
index 8f2c54a7beb6..904b5c336a99 100644
---
a/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpAuthenticationTest.java
+++
b/components/camel-platform-http-vertx/src/test/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpAuthenticationTest.java
@@ -17,10 +17,9 @@
package org.apache.camel.component.platform.http.vertx;
import io.restassured.RestAssured;
-import io.vertx.core.AsyncResult;
+import io.vertx.core.Future;
import io.vertx.ext.auth.User;
-import io.vertx.ext.auth.authentication.AuthenticationProvider;
-import io.vertx.ext.auth.impl.UserImpl;
+import io.vertx.ext.auth.authentication.UsernamePasswordCredentials;
import io.vertx.ext.auth.properties.PropertyFileAuthentication;
import io.vertx.ext.web.handler.BasicAuthHandler;
import org.apache.camel.CamelContext;
@@ -254,37 +253,12 @@ public class VertxPlatformHttpAuthenticationTest {
}
private AuthenticationProviderFactory createCustomProvider(String
username, String pass) {
- return vertx -> (AuthenticationProvider) (credentials, resultHandler)
-> {
- boolean usernameMatched =
credentials.getString("username").equals(username);
- boolean passwordMatched =
credentials.getString("password").equals(pass);
- if (usernameMatched && passwordMatched) {
- AsyncResult<User> result = getUser();
- resultHandler.handle(result);
- }
- };
- }
-
- private AsyncResult<User> getUser() {
- return new AsyncResult<>() {
- @Override
- public User result() {
- return new UserImpl();
- }
-
- @Override
- public Throwable cause() {
- return null;
- }
-
- @Override
- public boolean succeeded() {
- return true;
- }
-
- @Override
- public boolean failed() {
- return false;
+ return vertx -> credentials -> {
+ UsernamePasswordCredentials usernamePassword =
(UsernamePasswordCredentials) credentials;
+ if (usernamePassword.getUsername().equals(username) &&
usernamePassword.getPassword().equals(pass)) {
+ return Future.succeededFuture(User.fromName(username));
}
+ return Future.failedFuture("Invalid username or password");
};
}
diff --git
a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/TestVertxMetricsFactory.java
b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/TestVertxMetricsFactory.java
new file mode 100644
index 000000000000..ed83da9152d2
--- /dev/null
+++
b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/TestVertxMetricsFactory.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.vertx.http;
+
+import io.vertx.core.VertxOptions;
+import io.vertx.core.spi.VertxMetricsFactory;
+import io.vertx.core.spi.metrics.VertxMetrics;
+
+/**
+ * No-op {@link VertxMetricsFactory} discovered via the {@code ServiceLoader}
when metrics are enabled on
+ * {@link VertxOptions}.
+ */
+public class TestVertxMetricsFactory implements VertxMetricsFactory {
+
+ @Override
+ public VertxMetrics metrics(VertxOptions options) {
+ return new VertxMetrics() {
+ };
+ }
+}
diff --git
a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomVertxTest.java
b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomVertxTest.java
index 7c24d4b2ef3c..872577eb902f 100644
---
a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomVertxTest.java
+++
b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpCustomVertxTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.vertx.http;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.metrics.MetricsOptions;
-import io.vertx.core.metrics.impl.DummyVertxMetrics;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.junit.jupiter.api.Test;
@@ -64,7 +63,6 @@ public class VertxHttpCustomVertxTest {
public void testCustomVertxOptions() {
MetricsOptions metrics = new MetricsOptions();
metrics.setEnabled(true);
- metrics.setFactory(options -> DummyVertxMetrics.INSTANCE);
VertxOptions options = new VertxOptions();
options.setMetricsOptions(metrics);
diff --git
a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpTestSupport.java
b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpTestSupport.java
index 3407fcdbc358..9789cb7de98f 100644
---
a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpTestSupport.java
+++
b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpTestSupport.java
@@ -22,8 +22,8 @@ import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.VertxException;
import io.vertx.core.VertxOptions;
-import io.vertx.core.impl.VertxInternal;
-import io.vertx.core.impl.btc.BlockedThreadEvent;
+import io.vertx.core.internal.VertxInternal;
+import io.vertx.core.internal.threadchecker.BlockedThreadEvent;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit6.CamelTestSupport;
import org.junit.jupiter.api.extension.RegisterExtension;
diff --git
a/components/camel-vertx/camel-vertx-http/src/test/resources/META-INF/services/io.vertx.core.spi.VertxServiceProvider
b/components/camel-vertx/camel-vertx-http/src/test/resources/META-INF/services/io.vertx.core.spi.VertxServiceProvider
new file mode 100644
index 000000000000..fcf86a7cb545
--- /dev/null
+++
b/components/camel-vertx/camel-vertx-http/src/test/resources/META-INF/services/io.vertx.core.spi.VertxServiceProvider
@@ -0,0 +1 @@
+org.apache.camel.component.vertx.http.TestVertxMetricsFactory
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketClientConsumer.java
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketClientConsumer.java
index 49d1ea8470ba..8eb8989faa66 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketClientConsumer.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketClientConsumer.java
@@ -24,7 +24,6 @@ import java.util.concurrent.locks.ReentrantLock;
import io.vertx.core.Vertx;
import io.vertx.core.http.WebSocket;
-import io.vertx.core.net.impl.ConnectionBase;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
@@ -88,7 +87,7 @@ public class VertxWebsocketClientConsumer extends
DefaultConsumer {
if (reconnect && mine != null && !isStarted()) {
// Stopped while connecting. Not for a WebSocket that was
already open: it belongs to the endpoint.
discarded = mine;
- mine.close();
+ getEndpoint().discardWebSocket(mine);
return null;
}
return webSocket;
@@ -123,13 +122,12 @@ public class VertxWebsocketClientConsumer extends
DefaultConsumer {
}
});
webSocket.exceptionHandler(exception -> {
- Throwable cause = exception.getCause();
- if (cause == ConnectionBase.CLOSED_EXCEPTION) {
+ if (VertxWebsocketHelper.isConnectionClosed(exception)) {
// Ignore as there's already a close handler registered
return;
}
Exchange exchange = createExchange(false);
- getExceptionHandler().handleException("Error processing exchange",
exchange, cause);
+ getExceptionHandler().handleException("Error processing exchange",
exchange, exception);
releaseExchange(exchange, false);
});
}
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketConsumer.java
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketConsumer.java
index 98194669d9a3..d5794669493c 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketConsumer.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketConsumer.java
@@ -20,7 +20,6 @@ import java.util.Map;
import io.vertx.core.http.ServerWebSocket;
import io.vertx.core.net.SocketAddress;
-import io.vertx.core.net.impl.ConnectionBase;
import io.vertx.ext.web.RoutingContext;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
@@ -74,7 +73,7 @@ public class VertxWebsocketConsumer extends DefaultConsumer {
}
public void onException(String connectionKey, Throwable cause,
SocketAddress remote, RoutingContext routingContext) {
- if (cause == ConnectionBase.CLOSED_EXCEPTION) {
+ if (VertxWebsocketHelper.isConnectionClosed(cause)) {
// Ignore as VertxWebsocketHost registers a closeHandler to trap
WebSocket close events
return;
}
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketEndpoint.java
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketEndpoint.java
index 4a782648de1c..bd5de01d716b 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketEndpoint.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketEndpoint.java
@@ -191,6 +191,19 @@ public class VertxWebsocketEndpoint extends
DefaultEndpoint implements EndpointS
this.handlerOwner = consumer;
}
+ /**
+ * Closes the given WebSocket, and makes the next {@link #getWebSocket()}
connect again instead of returning it. A
+ * WebSocket only reports itself as closed once the closing handshake with
the server is done. The caller must hold
+ * {@link #clientConsumerConnectLock}.
+ */
+ void discardWebSocket(WebSocket discarded) {
+ if (webSocket == discarded) {
+ webSocket = null;
+ handlerOwner = null;
+ }
+ discarded.close();
+ }
+
protected WebSocket getWebSocket() throws Exception {
return getWebSocket((java.util.function.Consumer<WebSocket>) null);
}
@@ -276,7 +289,13 @@ public class VertxWebsocketEndpoint extends
DefaultEndpoint implements EndpointS
}
protected WebSocket getWebSocket(Exchange exchange) throws Exception {
- return getWebSocket().exceptionHandler(event ->
exchange.setException(event.getCause()));
+ // The handler stays on the WebSocket after the exchange is done. A
lost connection is not set on the exchange: a
+ // closed WebSocket is replaced by a new connection on the next send,
and a write in flight fails through its result
+ return getWebSocket().exceptionHandler(exception -> {
+ if (!VertxWebsocketHelper.isConnectionClosed(exception)) {
+ exchange.setException(exception);
+ }
+ });
}
protected WebSocketConnectOptions
getWebSocketConnectOptions(WebSocketClientOptions options) {
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHelper.java
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHelper.java
index 883a4effc525..a1826f1ad4e6 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHelper.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/main/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHelper.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.vertx.websocket;
import java.net.URI;
import java.util.Map;
+import io.vertx.core.http.HttpClosedException;
import org.apache.camel.util.CollectionHelper;
import org.apache.camel.util.ObjectHelper;
@@ -28,6 +29,15 @@ public final class VertxWebsocketHelper {
// Utility class
}
+ /**
+ * Whether the given exception reports a WebSocket connection that was
closed without a close frame. Such a close is
+ * reported by the close handler, so the exception carries no further
information. A close caused by an HTTP/2
+ * GOAWAY is not included, as its error code is worth reporting.
+ */
+ public static boolean isConnectionClosed(Throwable exception) {
+ return exception instanceof HttpClosedException closed &&
closed.goAway() == null;
+ }
+
/**
* Creates a VertxWebsocketHostKey from a given VertxWebsocketConfiguration
*/
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/TestVertxMetricsFactory.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/TestVertxMetricsFactory.java
new file mode 100644
index 000000000000..28da9db6f366
--- /dev/null
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/TestVertxMetricsFactory.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.vertx.websocket;
+
+import io.vertx.core.VertxOptions;
+import io.vertx.core.spi.VertxMetricsFactory;
+import io.vertx.core.spi.metrics.VertxMetrics;
+
+/**
+ * No-op {@link VertxMetricsFactory} discovered via the {@code ServiceLoader}
when metrics are enabled on
+ * {@link VertxOptions}.
+ */
+public class TestVertxMetricsFactory implements VertxMetricsFactory {
+
+ @Override
+ public VertxMetrics metrics(VertxOptions options) {
+ return new VertxMetrics() {
+ };
+ }
+}
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketEventTest.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketEventTest.java
index d4cfa4969061..8c72755f5839 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketEventTest.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketEventTest.java
@@ -60,7 +60,7 @@ public class VertxWebSocketEventTest extends
VertxWebSocketTestSupport {
// Trigger close event
CountDownLatch latch = new CountDownLatch(1);
- webSocket.close(event -> latch.countDown());
+ webSocket.close().onComplete(event -> latch.countDown());
assertTrue(latch.await(5, TimeUnit.SECONDS));
mockEndpoint.assertIsSatisfied();
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketTestSupport.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketTestSupport.java
index ff603c1debd7..51d52338f8b0 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketTestSupport.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebSocketTestSupport.java
@@ -29,13 +29,15 @@ import io.vertx.core.VertxOptions;
import io.vertx.core.http.ServerWebSocket;
import io.vertx.core.http.WebSocket;
import io.vertx.core.http.WebSocketClient;
-import io.vertx.core.impl.VertxInternal;
-import io.vertx.core.impl.btc.BlockedThreadEvent;
+import io.vertx.core.internal.VertxInternal;
+import io.vertx.core.internal.threadchecker.BlockedThreadEvent;
import io.vertx.ext.web.Route;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.RegisterExtension;
import static org.awaitility.Awaitility.await;
@@ -48,6 +50,15 @@ public class VertxWebSocketTestSupport extends
CamelTestSupport {
@RegisterExtension
AvailablePortFinder.Port port2 = AvailablePortFinder.find();
+ // Registered before the extension that stops the CamelContext (order 1),
so that its after each callback runs once
+ // the CamelContext is stopped: the routes may use a router created with
the client Vert.x
+ @RegisterExtension
+ @Order(0)
+ AfterEachCallback clientVertxCloser = extensionContext ->
closeClientVertx();
+
+ private Vertx clientVertx;
+ private WebSocketClient webSocketClient;
+
/**
* Returns the randomized port used for the Vert.x server if no port was
provided to the consumer.
*/
@@ -64,8 +75,7 @@ public class VertxWebSocketTestSupport extends
CamelTestSupport {
}
public WebSocket openWebSocketConnection(String host, int port, String
path, Consumer<String> handler) throws Exception {
- WebSocketClient client = Vertx.vertx().createWebSocketClient();
- CompletableFuture<WebSocket> future = client.connect(port, host, path)
+ CompletableFuture<WebSocket> future =
getWebSocketClient().connect(port, host, path)
.toCompletionStage()
.toCompletableFuture();
WebSocket webSocket = future.get(5, TimeUnit.SECONDS);
@@ -73,6 +83,35 @@ public class VertxWebSocketTestSupport extends
CamelTestSupport {
return webSocket;
}
+ /**
+ * The Vert.x instance used by the test for its clients and routers,
closed at the end of the test.
+ */
+ private synchronized Vertx getClientVertx() {
+ if (clientVertx == null) {
+ clientVertx = Vertx.vertx();
+ }
+ return clientVertx;
+ }
+
+ /**
+ * The client is kept until the end of the test, as a Vert.x WebSocket
client that is garbage collected closes its
+ * WebSockets.
+ */
+ private synchronized WebSocketClient getWebSocketClient() {
+ if (webSocketClient == null) {
+ webSocketClient = getClientVertx().createWebSocketClient();
+ }
+ return webSocketClient;
+ }
+
+ private synchronized void closeClientVertx() throws Exception {
+ if (clientVertx != null) {
+
clientVertx.close().toCompletionStage().toCompletableFuture().get(10,
TimeUnit.SECONDS);
+ clientVertx = null;
+ webSocketClient = null;
+ }
+ }
+
/**
* Waits for the given endpoint to have registered the expected number of
connected peers.
* <p>
@@ -91,7 +130,7 @@ public class VertxWebSocketTestSupport extends
CamelTestSupport {
}
public Router createRouter(String path, Handler<RoutingContext> handler,
CountDownLatch latch) {
- Router router = Router.router(Vertx.vertx());
+ Router router = Router.router(getClientVertx());
Route route = router.route(path);
if (handler == null) {
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketComponentConfigurationTest.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketComponentConfigurationTest.java
index 5ddc957e509e..114065bc579b 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketComponentConfigurationTest.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketComponentConfigurationTest.java
@@ -24,7 +24,6 @@ import io.vertx.core.VertxOptions;
import io.vertx.core.http.WebSocketClientOptions;
import io.vertx.core.http.WebSocketConnectOptions;
import io.vertx.core.metrics.MetricsOptions;
-import io.vertx.core.metrics.impl.DummyVertxMetrics;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.junit.jupiter.api.Test;
@@ -72,7 +71,6 @@ public class VertxWebsocketComponentConfigurationTest {
public void testCustomVertxOptions() {
MetricsOptions metrics = new MetricsOptions();
metrics.setEnabled(true);
- metrics.setFactory(options -> DummyVertxMetrics.INSTANCE);
VertxOptions options = new VertxOptions();
options.setMetricsOptions(metrics);
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketExternalServerTest.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketExternalServerTest.java
index b1d6dc653ff5..c31385e83ec9 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketExternalServerTest.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketExternalServerTest.java
@@ -70,7 +70,7 @@ public class VertxWebsocketExternalServerTest extends
VertxWebSocketTestSupport
request.pause();
}
// upgrade
- request.toWebSocket(toWebSocket -> {
+ request.toWebSocket().onComplete(toWebSocket -> {
if (toWebSocket.succeeded()) {
// resume the parsing
if (!parseEnded) {
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHandshakeHeadersTest.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHandshakeHeadersTest.java
index 42c79289d3d1..38345bb4931e 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHandshakeHeadersTest.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketHandshakeHeadersTest.java
@@ -77,7 +77,7 @@ public class VertxWebsocketHandshakeHeadersTest extends
VertxWebSocketTestSuppor
request.pause();
}
// upgrade
- request.toWebSocket(toWebSocket -> {
+ request.toWebSocket().onComplete(toWebSocket -> {
if (toWebSocket.succeeded()) {
// resume the parsing
if (!parseEnded) {
@@ -167,7 +167,7 @@ public class VertxWebsocketHandshakeHeadersTest extends
VertxWebSocketTestSuppor
}
// upgrade
- request.toWebSocket(toWebSocket -> {
+ request.toWebSocket().onComplete(toWebSocket -> {
if (toWebSocket.succeeded()) {
// resume the parsing
if (!parseEnded) {
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketSSLTest.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketSSLTest.java
index 51af01de398e..f2b24a997803 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketSSLTest.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketSSLTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.vertx.websocket;
import java.util.concurrent.TimeUnit;
import io.vertx.core.Vertx;
+import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.http.HttpClientResponse;
@@ -237,6 +238,7 @@ public class VertxWebsocketSSLTest extends
VertxWebSocketTestSupport {
context.start();
Vertx vertx = Vertx.vertx();
+ HttpClient client = null;
try {
// The JDK does not indicate a server name for localhost, so make
the client do it
HttpClientOptions clientOptions = new
HttpClientOptions().setForceSni(true);
@@ -244,7 +246,8 @@ public class VertxWebsocketSSLTest extends
VertxWebSocketTestSupport {
// A request that is not a WebSocket upgrade is rejected, which
can only happen once the TLS handshake
// has succeeded with the key material of the SSLContextParameters
on both sides
- int statusCode = vertx.createHttpClient(clientOptions)
+ client = vertx.createHttpClient(clientOptions);
+ int statusCode = client
.request(HttpMethod.GET, port.getPort(), "localhost",
"/echo")
.compose(HttpClientRequest::send)
.map(HttpClientResponse::statusCode)
@@ -254,6 +257,10 @@ public class VertxWebsocketSSLTest extends
VertxWebSocketTestSupport {
assertEquals(400, statusCode);
} finally {
+ // the client is closed explicitly, as one that is garbage
collected closes its connections
+ if (client != null) {
+ client.close();
+ }
vertx.close();
context.stop();
}
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketTest.java
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketTest.java
index 0a336cb58291..0ed9e7a7150c 100644
---
a/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketTest.java
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/java/org/apache/camel/component/vertx/websocket/VertxWebsocketTest.java
@@ -357,7 +357,10 @@ public class VertxWebsocketTest extends
VertxWebSocketTestSupport {
results.add("/test-other should not have been called");
});
- template.sendBody("vertx-websocket:localhost:" + port +
"/test?sendToAll=true", "Hello World");
+ String uri = "vertx-websocket:localhost:" + port +
"/test?sendToAll=true";
+ awaitConnectedPeers(context.getEndpoint(uri,
VertxWebsocketEndpoint.class), expectedResultCount);
+
+ template.sendBody(uri, "Hello World");
assertTrue(latch.await(10, TimeUnit.SECONDS));
assertEquals(expectedResultCount, results.size());
@@ -399,7 +402,10 @@ public class VertxWebsocketTest extends
VertxWebSocketTestSupport {
results.add("/test-other should not have been called");
});
- template.sendBodyAndHeader("vertx-websocket:localhost:" + port +
"/test", "Hello World",
+ String uri = "vertx-websocket:localhost:" + port + "/test";
+ awaitConnectedPeers(context.getEndpoint(uri,
VertxWebsocketEndpoint.class), expectedResultCount);
+
+ template.sendBodyAndHeader(uri, "Hello World",
VertxWebsocketConstants.SEND_TO_ALL, true);
assertTrue(latch.await(10, TimeUnit.SECONDS));
@@ -435,8 +441,10 @@ public class VertxWebsocketTest extends
VertxWebSocketTestSupport {
});
}
- template.sendBody("vertx-websocket:localhost:" + port +
"/test/firstParam/other/secondParam?sendToAll=true",
- "Hello World");
+ String uri = "vertx-websocket:localhost:" + port +
"/test/firstParam/other/secondParam?sendToAll=true";
+ awaitConnectedPeers(context.getEndpoint(uri,
VertxWebsocketEndpoint.class), expectedResultCount);
+
+ template.sendBody(uri, "Hello World");
assertTrue(latch.await(10, TimeUnit.SECONDS));
assertEquals(expectedResultCount, results.size());
@@ -468,7 +476,10 @@ public class VertxWebsocketTest extends
VertxWebSocketTestSupport {
});
}
- template.sendBody("vertx-websocket:localhost:" + port +
"/test/{paramA}/other/{paramB}?sendToAll=true", "Hello World");
+ String uri = "vertx-websocket:localhost:" + port +
"/test/{paramA}/other/{paramB}?sendToAll=true";
+ awaitConnectedPeers(context.getEndpoint(uri,
VertxWebsocketEndpoint.class), expectedResultCount);
+
+ template.sendBody(uri, "Hello World");
assertTrue(latch.await(10, TimeUnit.SECONDS));
assertEquals(expectedResultCount, results.size());
@@ -501,7 +512,10 @@ public class VertxWebsocketTest extends
VertxWebSocketTestSupport {
});
}
- template.sendBody("vertx-websocket:localhost:" + port +
"/test/wildcarded/path?sendToAll=true", "Hello World");
+ String uri = "vertx-websocket:localhost:" + port +
"/test/wildcarded/path?sendToAll=true";
+ awaitConnectedPeers(context.getEndpoint(uri,
VertxWebsocketEndpoint.class), expectedResultCount);
+
+ template.sendBody(uri, "Hello World");
assertTrue(latch.await(10, TimeUnit.SECONDS));
assertEquals(expectedResultCount, results.size());
@@ -533,7 +547,10 @@ public class VertxWebsocketTest extends
VertxWebSocketTestSupport {
});
}
- template.sendBody("vertx-websocket:localhost:" + port +
"/test/wildcarded/*?sendToAll=true", "Hello World");
+ String uri = "vertx-websocket:localhost:" + port +
"/test/wildcarded/*?sendToAll=true";
+ awaitConnectedPeers(context.getEndpoint(uri,
VertxWebsocketEndpoint.class), expectedResultCount);
+
+ template.sendBody(uri, "Hello World");
assertTrue(latch.await(10, TimeUnit.SECONDS));
assertEquals(expectedResultCount, results.size());
diff --git
a/components/camel-vertx/camel-vertx-websocket/src/test/resources/META-INF/services/io.vertx.core.spi.VertxServiceProvider
b/components/camel-vertx/camel-vertx-websocket/src/test/resources/META-INF/services/io.vertx.core.spi.VertxServiceProvider
new file mode 100644
index 000000000000..40c7b31acdf7
--- /dev/null
+++
b/components/camel-vertx/camel-vertx-websocket/src/test/resources/META-INF/services/io.vertx.core.spi.VertxServiceProvider
@@ -0,0 +1 @@
+org.apache.camel.component.vertx.websocket.TestVertxMetricsFactory
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 78e27aeb64fc..fdb8d76a2559 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -51,6 +51,43 @@ evaluation capture. For external readers, `retained` is
`unknown` instead of a c
and responses; backend implementations may split retrieval into their own
batches. The 100-reference
limit on legacy persisted evidence records remains unchanged.
+=== Vert.x 5
+
+Camel now uses Vert.x 5. This affects `camel-vertx`, `camel-vertx-http`,
`camel-vertx-websocket`,
+`camel-platform-http-vertx`, `camel-platform-http-main`,
`camel-platform-http-jolokia`, `camel-knative-http`
+and `camel-oauth`. Application code that uses the Vert.x API directly, for
example to create a custom `Vertx`
+instance, a custom `Router` handler, or an authentication provider for
platform-http, must be migrated as
+described in the https://vertx.io/docs/guides/vertx-5-migration-guide/[Vert.x
5 migration guide]. Notably,
+the callback variants of asynchronous methods are removed in favour of the
methods returning a `Future`.
+
+A metrics or tracing factory can no longer be set on the `VertxOptions` given
to a component (the
+`MetricsOptions.setFactory` and `TracingOptions.setFactory` methods are
removed). Either create the `Vertx`
+instance with `Vertx.builder()` and set it on the component (or bind it to the
registry), or register the factory
+as a `io.vertx.core.spi.VertxServiceProvider` service.
+
+`VertxPlatformHttpRouter.mountSubRouter` is removed, as it is no longer part
of the Vert.x `Router` API.
+Use `router.route(mountPoint + "*").subRouter(subRouter)` instead.
+
+When the connection of a WebSocket is lost without a close frame, the
`camel-vertx-websocket` consumer no longer
+passes the resulting exception to the consumer exception handler, and no
longer routes it as an `ERROR` event. It is
+handled as a WebSocket closed with a close frame: a consumer with
`fireWebSocketConnectionEvents=true` routes a `CLOSE`
+event, and a consumer with `consumeAsClient=true` reconnects. With the default
`fireWebSocketConnectionEvents=false`,
+the lost connection of a peer is therefore no longer logged as a warning.
+
+When the WebSocket of a consumer with `consumeAsClient=true` reports any other
error, the consumer exception handler
+now receives that exception. Previously it received the cause of that
exception, which could be `null`.
+
+When the WebSocket that the `camel-vertx-websocket` producer sends to (a
server not managed by Camel) reports an error
+other than a lost connection, the exchange now fails with that exception.
Previously it failed with the cause of that
+exception, which could be `null`.
+
+`camel-arangodb` still uses Vert.x 4, as the ArangoDB Java driver does not
support Vert.x 5 yet
+(see
https://github.com/arangodb/arangodb-java-driver/issues/625[arangodb-java-driver#625]).
An application that
+uses `camel-arangodb` together with one of the components above resolves a
single version of the `io.vertx`
+artifacts, so either the ArangoDB driver or the other components fail at
runtime. The workaround suggested by the
+driver maintainers is to replace `com.arangodb:arangodb-java-driver` with
`com.arangodb:arangodb-java-driver-shaded`,
+which embeds its own relocated copy of Vert.x. The `vertx` option of
`camel-arangodb` cannot be used in that case.
+
=== camel-jbang - camel validate and camel overview report the same endpoints
no route consumes
`camel validate source` and `camel overview` now use the same rules for a
`direct:`, `seda:` or `disruptor:` endpoint
diff --git a/dsl/camel-componentdsl/pom.xml b/dsl/camel-componentdsl/pom.xml
index 4cc942041f03..f5748d35fdec 100644
--- a/dsl/camel-componentdsl/pom.xml
+++ b/dsl/camel-componentdsl/pom.xml
@@ -115,6 +115,13 @@
<artifactId>netty-transport</artifactId>
<version>${netty-version}</version>
</dependency>
+ <!-- the generated Netty builders reference SslHandler; Vert.x 5
brings netty-handler in at runtime scope only -->
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ <version>${netty-version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
diff --git a/dsl/camel-endpointdsl/pom.xml b/dsl/camel-endpointdsl/pom.xml
index 17b3fc3b7e2e..d4e5bcd2126a 100644
--- a/dsl/camel-endpointdsl/pom.xml
+++ b/dsl/camel-endpointdsl/pom.xml
@@ -69,6 +69,13 @@
<artifactId>netty-transport</artifactId>
<version>${netty-version}</version>
</dependency>
+ <!-- the generated Netty builders reference SslHandler; Vert.x 5
brings netty-handler in at runtime scope only -->
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ <version>${netty-version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-allcomponents</artifactId>
diff --git a/parent/pom.xml b/parent/pom.xml
index 800acbfe8008..2ede68d3e2b4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -541,7 +541,7 @@
<univocity-parsers-version>2.10.2</univocity-parsers-version>
<velocity-tools-version>3.1</velocity-tools-version>
<velocity-version>2.4.1</velocity-version>
- <vertx-version>4.5.35</vertx-version>
+ <vertx-version>5.2.1</vertx-version>
<weaviate-client-version>6.3.1</weaviate-client-version>
<web3j-version>5.0.0</web3j-version>
<web3j-quorum-version>4.10.0</web3j-quorum-version>