[
https://issues.apache.org/jira/browse/CAMEL-20131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17788050#comment-17788050
]
Karen Lease commented on CAMEL-20131:
-------------------------------------
{quote}I assume this method with the Expression as first argument is to force
the Java DSL to then use expression builders easily.
{quote}
Yes, otherwise if only a Map is passed it ended up here as well. The option
would be to use only the varargs method and if there is a single argument which
is a Map then to handle it. That's probably a better plan and will probably
facilitate handling point 1 above as well.
> camel-core - SetHeaders EIP some small things we can improve
> ------------------------------------------------------------
>
> Key: CAMEL-20131
> URL: https://issues.apache.org/jira/browse/CAMEL-20131
> Project: Camel
> Issue Type: Improvement
> Components: camel-core, eip
> Affects Versions: 4.3.0
> Reporter: Claus Ibsen
> Assignee: Karen Lease
> Priority: Major
> Fix For: 4.3.0
>
>
> Lets polish this a bit more
> 1) Java DSL to accept vanilla Map
> from("direct:start").setHeaders(Map.of("a", 1, "b", 2, ...)).to("mock:result")
> The current API is Map<String, Expression> which wont allow the above. But we
> need both kind, but not sure if we can just add Map<String, Object> and have
> both variants.
> 2)
> I assume this method with the Expression as first argument is to force the
> Java DSL to then use expression builders easily. However maybe add some code
> comment why its this as we will forget in the future.
> public Type setHeaders(String headerName, Expression expr, Object...
> headerNamesAndValues) {
> 3)
> Add Map.of as example in the documentation
> 4)
> Add YAML DSL for the examples where its missing
--
This message was sent by Atlassian Jira
(v8.20.10#820010)