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 a1ddd806f39 CAMEL-18952: camel-rest - Favour using platform-http if
available on classpath
a1ddd806f39 is described below
commit a1ddd806f39ba9102627aff0bb62878e1b4c3268
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jan 18 20:10:58 2023 +0100
CAMEL-18952: camel-rest - Favour using platform-http if available on
classpath
---
.../main/java/org/apache/camel/component/rest/RestEndpoint.java | 9 +++++++++
1 file changed, 9 insertions(+)
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 b72ff9c6b40..026aca9831e 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
@@ -486,6 +486,15 @@ public class RestEndpoint extends DefaultEndpoint {
}
}
+ // favour using platform-http if available on classpath
+ if (factory == null) {
+ Object comp = getCamelContext().getComponent("platform-http",
true);
+ if (comp instanceof RestConsumerFactory) {
+ factory = (RestConsumerFactory) comp;
+ LOG.debug("Auto discovered platform-http as
RestConsumerFactory");
+ }
+ }
+
// lookup in registry
if (factory == null) {
Set<RestConsumerFactory> factories =
getCamelContext().getRegistry().findByType(RestConsumerFactory.class);