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 cf5f27e0d319 CAMEL-24849: camel-http is the default REST producer
client, first in the rest component's default list and what the Camel CLI adds
for a rest-openapi producer (#26625)
cf5f27e0d319 is described below
commit cf5f27e0d319ae0329573637d71615a8045989b8
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Sep 20 12:42:49 2026 +0200
CAMEL-24849: camel-http is the default REST producer client, first in the
rest component's default list and what the Camel CLI adds for a rest-openapi
producer (#26625)
vertx-http came first in RestEndpoint.DEFAULT_REST_PRODUCER_COMPONENTS and
the CLI downloaded camel-vertx-http for rest-openapi, so an application with
both clients, or any camel run, called through Vert.x without having chosen it.
camel-http is the reference client and the one most runtimes carry. A single
client on the classpath, or a componentName, is not affected; the 4.23 upgrade
guide has the note.
---
.../apache/camel/catalog/docs/rest-openapi-component.adoc | 12 ++++++++----
.../src/main/docs/rest-openapi-component.adoc | 12 ++++++++----
.../java/org/apache/camel/component/rest/RestEndpoint.java | 3 ++-
.../modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc | 10 ++++++++++
.../main/download/DependencyDownloaderComponentResolver.java | 4 ++--
5 files changed, 30 insertions(+), 11 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-openapi-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-openapi-component.adoc
index bc999a9da000..19e3c4824ff6 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-openapi-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/rest-openapi-component.adoc
@@ -83,10 +83,14 @@ requests, this named component needs to be present in the
Camel context
and implement the required _RestProducerFactory_ interface -- as do the
components listed at the top.
-If you do not specify the _componentName_ at either component or
-endpoint level, `_CLASSPATH_` is searched for a suitable delegate. There
-should be only one component present on the `_CLASSPATH_` that implements
-the `RestProducerFactory` interface for this to work.
+If you do not specify the _componentName_ at either component or
+endpoint level, a suitable delegate is looked up: a component already
+in the Camel context that implements `RestProducerFactory`, then the
+registry, then the default components in this order: `http`,
+`vertx-http`, `undertow`, `netty-http`. So with both camel-http and
+camel-vertx-http on the classpath, camel-http is used unless you name
+the other. The Camel CLI (`camel run`) adds camel-http for a
+rest-openapi producer.
This component's endpoint URI is lenient which means that in addition
to message headers you can specify REST operation's parameters as
diff --git
a/components/camel-rest-openapi/src/main/docs/rest-openapi-component.adoc
b/components/camel-rest-openapi/src/main/docs/rest-openapi-component.adoc
index bc999a9da000..19e3c4824ff6 100644
--- a/components/camel-rest-openapi/src/main/docs/rest-openapi-component.adoc
+++ b/components/camel-rest-openapi/src/main/docs/rest-openapi-component.adoc
@@ -83,10 +83,14 @@ requests, this named component needs to be present in the
Camel context
and implement the required _RestProducerFactory_ interface -- as do the
components listed at the top.
-If you do not specify the _componentName_ at either component or
-endpoint level, `_CLASSPATH_` is searched for a suitable delegate. There
-should be only one component present on the `_CLASSPATH_` that implements
-the `RestProducerFactory` interface for this to work.
+If you do not specify the _componentName_ at either component or
+endpoint level, a suitable delegate is looked up: a component already
+in the Camel context that implements `RestProducerFactory`, then the
+registry, then the default components in this order: `http`,
+`vertx-http`, `undertow`, `netty-http`. So with both camel-http and
+camel-vertx-http on the classpath, camel-http is used unless you name
+the other. The Camel CLI (`camel run`) adds camel-http for a
+rest-openapi producer.
This component's endpoint URI is lenient which means that in addition
to message headers you can specify REST operation's parameters as
diff --git
a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
index 926695b042fe..e4275bca1c72 100644
---
a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
+++
b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
@@ -59,8 +59,9 @@ public class RestEndpoint extends DefaultEndpoint {
public static final String[] DEFAULT_REST_CONSUMER_COMPONENTS
= new String[] { "platform-http", "servlet", "jetty", "undertow",
"netty-http", "coap" };
+ // camel-http first: the reference HTTP client, and the one most runtimes
carry (CAMEL-24849)
public static final String[] DEFAULT_REST_PRODUCER_COMPONENTS
- = new String[] { "vertx-http", "http", "undertow", "netty-http" };
+ = new String[] { "http", "vertx-http", "undertow", "netty-http" };
public static final String DEFAULT_API_COMPONENT_NAME = "openapi";
public static final String RESOURCE_PATH =
"META-INF/services/org/apache/camel/rest/";
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
index 886f1dfbee56..5938aeccfa92 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
@@ -761,6 +761,16 @@ polyglot `Value` itself needs to work with these types
instead.
`JavaScriptHelper.newContext()` is deprecated: contexts are created by the
language from its shared engine.
+=== camel-rest, camel-rest-openapi, camel-jbang - camel-http is the default
REST client
+
+When a REST producer (`rest:` in producer mode, or `rest-openapi` calling an
operation of a contract) has no
+`componentName` (`producerComponentName`) and no `RestProducerFactory`
component exists in the context or the
+registry yet, the default components are tried in the order `http`,
`vertx-http`, `undertow`, `netty-http`;
+before, `vertx-http` came first. An application with both camel-http and
camel-vertx-http on the classpath now calls
+through camel-http; set `componentName=vertx-http` to keep the Vert.x client.
An application with only one of them
+is not affected. The Camel CLI (`camel run`) now adds camel-http, not
camel-vertx-http, for a rest-openapi producer
+without `componentName`.
+
=== camel-jbang
The `--runtime` option of `camel run` has a new default value `jbang`, which
is the existing in-process
diff --git
a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderComponentResolver.java
b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderComponentResolver.java
index a67d2b75da11..c83de375c73b 100644
---
a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderComponentResolver.java
+++
b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/DependencyDownloaderComponentResolver.java
@@ -95,8 +95,8 @@ public final class DependencyDownloaderComponentResolver
extends DefaultComponen
if (oa != null) {
downloadLoader(oa.getGroupId(), oa.getArtifactId(),
oa.getVersion());
}
- // include producer component
- ComponentModel http = catalog.componentModel("vertx-http");
+ // include the default producer component (camel-http, CAMEL-24849)
+ ComponentModel http = catalog.componentModel("http");
if (http != null) {
downloadLoader(http.getGroupId(), http.getArtifactId(),
http.getVersion());
}