You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/01/26 05:54:48 UTC
[camel] branch camel-3.14.x updated: adding an example to setHeader-eip.adoc (#6827)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.14.x by this push:
new 7141cb2 adding an example to setHeader-eip.adoc (#6827)
7141cb2 is described below
commit 7141cb29eac0c657840c7b4d8c5216b05ec7a842
Author: Chirag <cs...@manh.com>
AuthorDate: Wed Jan 26 00:54:18 2022 -0500
adding an example to setHeader-eip.adoc (#6827)
Updating setHeader-eip.adoc to include a sample of fluent syntax.
---
.../src/main/docs/modules/eips/pages/setHeader-eip.adoc | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/setHeader-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/setHeader-eip.adoc
index 671a6e6..2ef8ba9 100644
--- a/core/camel-core-engine/src/main/docs/modules/eips/pages/setHeader-eip.adoc
+++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/setHeader-eip.adoc
@@ -61,6 +61,16 @@ And in XML:
</route>
----
+Header can be set using fluent syntax.
+
+[source,java]
+----
+from("direct:a")
+ .setHeader("randomNumber").simple("${random(1,100)}")
+ .to("direct:b");
+----
+See xref:components:languages:jsonpath-language.adoc#_using_header_as_input[JSONPath] for another example.
+
=== Setting a header from another header
You can also set a header with the value from another header.