[
https://issues.apache.org/jira/browse/CAMEL-11532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264810#comment-16264810
]
ASF GitHub Bot commented on CAMEL-11532:
----------------------------------------
sermojohn commented on issue #2098: CAMEL-11532 Java DSL enhancement to accept
supplier and function arguments
URL: https://github.com/apache/camel/pull/2098#issuecomment-346702388
@davsclaus thank you for the review. I fixed the above issues.
I realized that `transform().inMessage(...)` replaces the OUT/IN Message
body, exactly as `transform().body(...)` does. So, I removed the
`inMessage(Supplier<>)` method (that was added in my first commit), as it would
have the save effect as `body(Supplier<>).` It can be used when we need to
calculate the new body taking the IN message into account.
Additionally, it seems (to me) that `transform(...)` does not differ from
`setBody(...)` expression (also verified by comparing TransformProcessor and
SetBodyProcessor). Both replace the body of IN or OUT message. What is the
reason of providing both expressions (apart from backwards compatibility) ?
Maybe I am missing something.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> java 8 dsl : allow to set the body using a supplier
> ----------------------------------------------------
>
> Key: CAMEL-11532
> URL: https://issues.apache.org/jira/browse/CAMEL-11532
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Luca Burgazzoli
> Assignee: Luca Burgazzoli
> Priority: Minor
> Fix For: 2.21.0
>
>
> Example:
> {code:java}
> from("timer")
> .setBody(User::new);
> from("timer")
> .trasform()
> .body(User::new);
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)