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

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


The following commit(s) were added to refs/heads/camel-3.14.x by this push:
     new a8e6f31  [CAMEL-17618]camel-ref: only add the endpoint into 
camelContext when not exist (#6905)
a8e6f31 is described below

commit a8e6f31a8d0dddd023820fed58eb2894010aa3d8
Author: Freeman(Yue) Fang <[email protected]>
AuthorDate: Wed Feb 9 06:27:30 2022 -0500

    [CAMEL-17618]camel-ref: only add the endpoint into camelContext when not 
exist (#6905)
---
 .../src/main/java/org/apache/camel/component/ref/RefEndpoint.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java
 
b/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java
index 4a8645d..caef53d8 100644
--- 
a/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java
+++ 
b/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java
@@ -77,7 +77,9 @@ public class RefEndpoint extends DefaultEndpoint implements 
DelegateEndpoint {
         if (endpoint == null) {
             // endpoint is mandatory
             endpoint = CamelContextHelper.mandatoryLookup(getCamelContext(), 
name, Endpoint.class);
-            getCamelContext().addEndpoint(getEndpoint().getEndpointUri(), 
endpoint);
+            if (getCamelContext().getEndpoint(getEndpoint().getEndpointUri()) 
== null) {
+                getCamelContext().addEndpoint(getEndpoint().getEndpointUri(), 
endpoint);
+            }
         }
         super.doInit();
     }

Reply via email to