This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new 813833a6fb2 CAMEL-18952: camel-rest - Favour using platform-http if 
available on classpath
813833a6fb2 is described below

commit 813833a6fb2bd7b6710147a4933feff593b35392
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 8870a05038c..cfc1881c0ac 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
@@ -499,6 +499,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);

Reply via email to