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 09:24:37 UTC

[GitHub] [camel-quarkus] ppalaga opened a new pull request #3029: property attribute with @Consume does not work

ppalaga opened a new pull request #3029:
URL: https://github.com/apache/camel-quarkus/pull/3029


   Fix #3021


-- 
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



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

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

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



[GitHub] [camel-quarkus] jamesnetherton merged pull request #3029: property attribute with @Consume does not work

Posted by GitBox <gi...@apache.org>.
jamesnetherton merged pull request #3029:
URL: https://github.com/apache/camel-quarkus/pull/3029


   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #3029:
URL: https://github.com/apache/camel-quarkus/pull/3029#issuecomment-904558726


   97a4591:
   * Fixed the flawed propertyName.startsWith("on") condition as reported by @aldettinger 


-- 
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