Claus Ibsen created CAMEL-20131:
-----------------------------------

             Summary: 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
             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)

Reply via email to