[
https://issues.apache.org/jira/browse/CAMEL-12910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16679386#comment-16679386
]
Cristian Donoiu commented on CAMEL-12910:
-----------------------------------------
Hi [~onders], thank you for looking into this.
I looked at [10845|https://issues.apache.org/jira/browse/CAMEL-10845] and
although has similarities it is quite different. The current bean integration
of Camel implies referencing the methods by their name as a string.
I wanted to follow the process by opening this ticket but *if* needed I can
fork a branch, do the improvement myself and then a pull request at the end.
Just need green light from one of the *top* contributors before starting to
work on this.
> Add support for method references bean::methodName
> --------------------------------------------------
>
> Key: CAMEL-12910
> URL: https://issues.apache.org/jira/browse/CAMEL-12910
> Project: Camel
> Issue Type: Improvement
> Components: camel-core, camel-spring-integration
> Reporter: Cristian Donoiu
> Priority: Major
> Labels: features
> Attachments: Bean.java
>
>
> Hi
> This is not related only to spring integration.
> I like to be able to use a spring service annotated class or bean directly
> from route but without using the method name as string, i.e. .bean(instance,
> "<method name") and instead use a method reference: .bean(instance::method)
> But why?:
> *1.* not being able to navigate quickly(open) that method from the IDE. Need
> to do some intermediary steps to reach that method.
> *2.* using of reflection internally by Camel to call that method.
> *3.* not being able to rename the method without breaking the route.
> *4.* not being able to see quickly (Alt+F7) who calls a methods in the IDE.
> *5.* using strings to reference a method when we have method references seems
> *not right.*
> As a workaround I had to add a helper class to simulate passing of method
> references and then internally to translate to method.
> In case it helps explaining I am attaching the helper Bean.java class (you
> can use it for free or to do better).
> You can use the class in any route like this:
> from (X)
> .bean(*call*(cancelSubscriptionService::buildSalesforceCase))
> .to(Y)
> .routeId(Z);
> As you see I am forced to use the intermediary helper 'call' in order to
> translate to an Expression.
> I would like to not have to use my helper and have the support built directly
> into Camel if possible. Let me know if there is a better solution to my
> problem.
> Thanks
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)