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 382cd2a1293c CAMEL-16861: Update docs
382cd2a1293c is described below
commit 382cd2a1293cf3304a313ea8d6beae55e9bcc252
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Feb 16 12:31:11 2026 +0100
CAMEL-16861: Update docs
---
.../docs/modules/eips/pages/resequence-eip.adoc | 251 ++++++++++++++++++++-
.../apache/camel/model/ResequenceDefinition.java | 2 +
.../java/org/apache/camel/util/SensitiveUtils.java | 2 +-
3 files changed, 252 insertions(+), 3 deletions(-)
diff --git
a/core/camel-core-engine/src/main/docs/modules/eips/pages/resequence-eip.adoc
b/core/camel-core-engine/src/main/docs/modules/eips/pages/resequence-eip.adoc
index 7cdc8068b945..c5df117cda27 100644
---
a/core/camel-core-engine/src/main/docs/modules/eips/pages/resequence-eip.adoc
+++
b/core/camel-core-engine/src/main/docs/modules/eips/pages/resequence-eip.adoc
@@ -84,6 +84,23 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ simple:
+ expression: "${body}"
+ steps:
+ - to:
+ uri: mock:result
+----
====
The batch resequencer can be further configured via the `size()` and
`timeout()` methods:
@@ -112,6 +129,26 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ simple:
+ expression: "${body}"
+ batchConfig:
+ batchSize: 300
+ batchTimeout: 4000
+ steps:
+ - to:
+ uri: mock:result
+----
====
This sets the batch size to 300 and the batch timeout to 4000 ms (by default,
@@ -144,6 +181,23 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: mySeqNo
+ steps:
+ - to:
+ uri: mock:result
+----
====
This reorders messages using a custom sequence number with the header name
mySeqNo.
@@ -179,6 +233,25 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: mySeqNo
+ batchConfig:
+ allowDuplicates: "true"
+ steps:
+ - to:
+ uri: mock:result
+----
====
=== Reverse Ordering
@@ -214,6 +287,25 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: mySeqNo
+ batchConfig:
+ reverse: "true"
+ steps:
+ - to:
+ uri: mock:result
+----
====
=== Ignoring invalid messages
@@ -251,6 +343,25 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: seqno
+ batchConfig:
+ ignoreInvalidExchanges: "true"
+ steps:
+ - to:
+ uri: mock:result
+----
====
This option is available for both batch and stream mode.
@@ -260,6 +371,13 @@ This option is available for both batch and stream mode.
It's now much easier to use the Resequencer to resequence messages from JMS
queues based on JMSPriority.
For that to work, you need to use the two new options `allowDuplicates` and
`reverse`.
+Notice this is *only* possible in the `batch` mode of the Resequencer.
+
+[tabs]
+====
+
+Java::
++
[source,java]
----
from("jms:queue:foo")
@@ -270,8 +388,41 @@ from("jms:queue:foo")
.to("mock:result");
----
-Notice this is *only* possible in the `batch` mode of the Resequencer.
+XML::
++
+[source,xml]
+----
+<route>
+ <from uri="jms:queue:foo"/>
+ <resequence>
+ <header>JMSPriority</header>
+ <batchConfig reverse="true" allowDuplicates="true"
batchTimeout="3000"/>
+ <to uri="mock:result"/>
+ </resequence>
+</route>
+----
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: jms:queue:foo
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: JMSPriority
+ batchConfig:
+ reverse: "true"
+ allowDuplicates: "true"
+ batchTimeout: 3000
+ steps:
+ - to:
+ uri: mock:result
+----
+====
== Stream Resequencing
@@ -307,6 +458,24 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: seqnum
+ streamConfig: {}
+ steps:
+ - to:
+ uri: mock:result
+----
====
The Resequencer keeps a backlog of pending messages in a backlog.
@@ -336,6 +505,26 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: seqno
+ streamConfig:
+ timeout: 4000
+ capacity: 5000
+ steps:
+ - to:
+ uri: mock:result
+----
====
This uses a capacity of 5000 elements. And the timeout has been set to 4
seconds.
@@ -393,6 +582,10 @@ public class MyFileNameExpression implements Expression {
And then you can use this expression in a Camel route:
+[tabs]
+====
+Java::
++
[source,java]
----
from("direct:start")
@@ -400,6 +593,41 @@ from("direct:start")
.to("mock:result");
----
+XML::
++
+[source,xml]
+----
+<route>
+ <from uri="direct:start"/>
+ <resequence>
+ <method beanType="com.foo.MyFileNameExpression"/>
+ <streamConfig timeout="2000"/>
+ <to uri="mock:result"/>
+ </resequence>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ method:
+ beanType: com.foo.MyFileNameExpression
+ streamConfig:
+ timeout: 2000
+ steps:
+ - to:
+ uri: mock:result
+----
+====
+
+
=== Rejecting old messages
Rejecting old messages is used to prevent out of order messages from being
sent,
@@ -436,6 +664,25 @@ XML::
</resequence>
</route>
----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - resequence:
+ expression:
+ header:
+ expression: seqno
+ streamConfig:
+ rejectOld: "true"
+ steps:
+ - to:
+ uri: mock:result
+----
====
-If an old message is detected then Camel throws `MessageRejectedException`.
+If an old message is detected then Camel throws `MessageRejectedException`
exception.
diff --git
a/core/camel-core-model/src/main/java/org/apache/camel/model/ResequenceDefinition.java
b/core/camel-core-model/src/main/java/org/apache/camel/model/ResequenceDefinition.java
index af4b976c609c..d556687a404b 100644
---
a/core/camel-core-model/src/main/java/org/apache/camel/model/ResequenceDefinition.java
+++
b/core/camel-core-model/src/main/java/org/apache/camel/model/ResequenceDefinition.java
@@ -118,6 +118,7 @@ public class ResequenceDefinition extends
OutputDefinition<ResequenceDefinition>
*/
public ResequenceDefinition stream(StreamResequencerConfig config) {
this.streamConfig = config;
+ this.resequencerConfig = config;
this.batchConfig = null;
return this;
}
@@ -130,6 +131,7 @@ public class ResequenceDefinition extends
OutputDefinition<ResequenceDefinition>
*/
public ResequenceDefinition batch(BatchResequencerConfig config) {
this.batchConfig = config;
+ this.resequencerConfig = config;
this.streamConfig = null;
return this;
}
diff --git
a/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
b/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
index 6a30c18ffb2e..38612d986e70 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/SensitiveUtils.java
@@ -210,7 +210,7 @@ public final class SensitiveUtils {
+ "|\\Qverificationcode\\E"
+
"|\\Qwebhookverifytoken\\E"
+
"|\\Qzookeeperpassword\\E"
- // SENSITIVE-PATTERN: END
+ // SENSITIVE-PATTERN: END
;
private SensitiveUtils() {