You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/08/24 11:30:48 UTC

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #3029: property attribute with @Consume does not work

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



##########
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:
       Good catch, thanks! Let me fix it.




-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org