aldettinger commented on a change in pull request #3029:
URL: https://github.com/apache/camel-quarkus/pull/3029#discussion_r694754699



##########
File path: 
extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/ConsumeProcessor.java
##########
@@ -187,6 +212,28 @@ void generateConsumeRoutes(
         }
     }
 
+    private String findEndpointMethodName(final String propertyName, ClassInfo 
declaringClass, List<String> triedMethods) {
+        /* Here we attempt to mimic what Camel does
+         * in 
org.apache.camel.impl.engine.CamelPostProcessorHelper.doGetEndpointInjection(Object,
 String, String) */
+        final String isGetter = "is" + StringHelper.capitalize(propertyName, 
false);
+        final String getGetter = "get" + StringHelper.capitalize(propertyName, 
false);
+        Optional<MethodInfo> method = Stream.of(isGetter, getGetter, isGetter 
+ "Endpoint", getGetter + "Endpoint")
+                .peek(triedMethods::add)
+                .map(declaringClass::method)
+                .filter(m -> m != null)
+                .findFirst();
+        if (propertyName.startsWith("on")) {

Review comment:
       So, it can be that we have found a matching method but still we try 
onXXX ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to