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 3c81a9c04b7 CAMEL-20798: Add endpoint service registry
3c81a9c04b7 is described below

commit 3c81a9c04b7f46762e9e4c65f3d7f551eceef2a5
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Jun 3 13:10:26 2024 +0200

    CAMEL-20798: Add endpoint service registry
---
 .../apache/camel/impl/engine/DefaultEndpointServiceRegistry.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultEndpointServiceRegistry.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultEndpointServiceRegistry.java
index 5120975d288..c949d02ed40 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultEndpointServiceRegistry.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultEndpointServiceRegistry.java
@@ -90,6 +90,13 @@ public class DefaultEndpointServiceRegistry extends 
ServiceSupport implements En
                 hits = s.getHits();
                 routeId = s.getRouteId();
             }
+            if ("out".equals(dir) && stat.isEmpty()) {
+                // no OUT stat, then the endpoint may be used only for IN
+                stat = findStats(endpoint.getEndpointUri(), "in");
+                if (stat.isPresent()) {
+                    return null;
+                }
+            }
             answer = new DefaultEndpointService(
                     component, endpoint.getEndpointUri(), adr, 
esl.getServiceProtocol(), esl.getServiceMetadata(),
                     hosted, dir, hits, routeId);

Reply via email to