davsclaus commented on PR #9510: URL: https://github.com/apache/camel/pull/9510#issuecomment-1465121743
okay but this PR is wrong as the Route DSL uses the mode/expression, and Java API uses the object as-is. So to set a constant value, set it directly. The setHeader/setProperty are optimized for core use and we should not add overhead with this. Also when you set the value you evaluate it as well this is wrong, as some Camel components allow using an Expression as a header for dynamic computation that they evaluate later. So the correct solution is to exchange.getMessage().setHeader("name", "value") -- 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-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org