This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new bc5163781844 CAMEL-16861: Update docs
bc5163781844 is described below
commit bc516378184490eb5f126da35bbc1641a1b55680
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Feb 14 10:37:58 2026 +0100
CAMEL-16861: Update docs
---
.../modules/eips/pages/durable-subscriber.adoc | 24 ++++++++
.../main/docs/modules/eips/pages/enrich-eip.adoc | 4 --
.../docs/modules/eips/pages/event-message.adoc | 69 +++++++++++++++++++++-
.../src/main/resources/templates/code-java.tmpl | 1 +
4 files changed, 92 insertions(+), 6 deletions(-)
diff --git
a/core/camel-core-engine/src/main/docs/modules/eips/pages/durable-subscriber.adoc
b/core/camel-core-engine/src/main/docs/modules/eips/pages/durable-subscriber.adoc
index a8f0ddef52e0..e5b0a3cc9466 100644
---
a/core/camel-core-engine/src/main/docs/modules/eips/pages/durable-subscriber.adoc
+++
b/core/camel-core-engine/src/main/docs/modules/eips/pages/durable-subscriber.adoc
@@ -52,4 +52,28 @@ XML::
</route>
</routes>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - to:
+ uri: activemq:topic:foo
+- route:
+ from:
+ uri: activemq:topic:foo?clientId=1&durableSubscriptionName=bar1
+ steps:
+ - to:
+ uri: mock:result1
+- route:
+ from:
+ uri: activemq:topic:foo?clientId=2&durableSubscriptionName=bar2
+ steps:
+ - to:
+ uri: mock:result2
+----
====
diff --git
a/core/camel-core-engine/src/main/docs/modules/eips/pages/enrich-eip.adoc
b/core/camel-core-engine/src/main/docs/modules/eips/pages/enrich-eip.adoc
index 0cf48fbed87d..750a9253b391 100644
--- a/core/camel-core-engine/src/main/docs/modules/eips/pages/enrich-eip.adoc
+++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/enrich-eip.adoc
@@ -96,9 +96,6 @@ XML::
+
[source,xml]
----
-<bean id="myStrategy" class="com.foo.ExampleAggregationStrategy"/>
-
-<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<enrich aggregationStrategy="myStrategy">
@@ -106,7 +103,6 @@ XML::
</enrich>
<to uri="mock:result"/>
</route>
-</camelContext>
----
YAML::
diff --git
a/core/camel-core-engine/src/main/docs/modules/eips/pages/event-message.adoc
b/core/camel-core-engine/src/main/docs/modules/eips/pages/event-message.adoc
index 9249bf2ca93c..ea56a582006b 100644
--- a/core/camel-core-engine/src/main/docs/modules/eips/pages/event-message.adoc
+++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/event-message.adoc
@@ -61,6 +61,18 @@ XML::
<to uri="activemq:queue:one-way"/>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: mq:someQueue?exchangePattern=InOnly
+ steps:
+ - to:
+ uri: activemq:queue:one-way
+----
====
== Using `setExchangePattern` EIP
@@ -89,6 +101,20 @@ XML::
<to uri="activemq:queue:one-way"/>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: mq:someQueue
+ steps:
+ - setExchangePattern:
+ pattern: InOnly
+ - to:
+ uri: activemq:queue:one-way
+----
====
When using `setExchangePattern` then the
xref:manual::exchange-pattern.adoc[Exchange Pattern]
@@ -96,16 +122,55 @@ on the xref:manual::exchange.adoc[Exchange] is changed
from this point onwards i
This means you can change the pattern back again at a later point:
+[tabs]
+====
+Java::
++
[source,java]
----
from("mq:someQueue")
.setExchangePattern(ExchangePattern.InOnly)
- .to("activemq:queue:one-way");
+ .to("activemq:queue:one-way")
.setExchangePattern(ExchangePattern.InOut)
.to("activemq:queue:in-and-out")
- .log("InOut MEP received ${body}")
+ .log("InOut MEP received ${body}");
----
+XML::
++
+[source,xml]
+----
+<route>
+ <from uri="mq:someQueue"/>
+ <setExchangePattern pattern="InOnly"/>
+ <to uri="activemq:queue:one-way"/>
+ <setExchangePattern pattern="InOut"/>
+ <to uri="activemq:queue:in-and-out"/>
+ <log message="InOut MEP received ${body}"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: mq:someQueue
+ steps:
+ - setExchangePattern:
+ pattern: InOnly
+ - to:
+ uri: activemq:queue:one-way
+ - setExchangePattern:
+ pattern: InOut
+ - to:
+ uri: activemq:queue:in-and-out
+ - log:
+ message: "InOut MEP received ${body}"
+----
+====
+
NOTE: Using `setExchangePattern` to change the
xref:manual::exchange-pattern.adoc[Exchange Pattern]
is often only used in special use-cases where you must
force to be using either `InOnly` or `InOut` mode when using components that
support both modes (such as messaging components like ActiveMQ, JMS, RabbitMQ
etc.)
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/code-java.tmpl
b/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/code-java.tmpl
index bc7951a62a2d..603f724e54c2 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/code-java.tmpl
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/resources/templates/code-java.tmpl
@@ -4,6 +4,7 @@ import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.model.*;
import org.apache.camel.spi.*;
+import org.apache.camel.*;
public class {{ .Name }} extends RouteBuilder {