Table of Contents
Resequences messages based on an expression
The Resequence pattern reorders messages according to a specified expression. It can be used in one of two modes:
The Resequence pattern can be placed anywhere in the body of a route. It supports only a single output.
Table 50, “Resequence Properties” describes the properties you can specify using the properties editor.
Table 50. Resequence Properties
| Name | Description |
|---|---|
| Specifies the expression language used to process the expression. |
| Specifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel. |
| Specifies a unique identifier for the endpoint. The tooling automatically generates an id for a node when it is created, but you can remove that id or replace it with your own. The Camel debugger requires all nodes with a breakpoint set to have a unique id. You can use the id to refer to endpoints in your Camel XML file. |
| Specifies the configuration for the resequencer:
Configure only one mode. |
batch-config configuration Table 51, “batch-config Properties” describes the properties you can specify using the properties editor.
Table 51. batch-config Properties
| Name | Description |
|---|---|
| Specifies whether the resequencer keeps duplicate messages (those having the same message expression). The default is Disabled, which forces the resequencer to keep only the last duplicate message. |
| Specifies the number of messages to include in the batch. The default is 100. |
| Specifies the amount of time, in milliseconds, the node will attempt to batch up the messages before timing out. The default is 1000. |
| Specifies whether the resequencer ignores invalid exchanges, those for which it
cannot evaluate the specified expression. The default is
Disabled, which results in the resequencer throwing a
|
| Specifies whether to reverse the priority of output based on expression ordering. By default, expression ordering is 0 → 9/A → Z, with highest priority given to lowest order expressions. The default is Disabled. For details, see Resequencer. |
stream-config configuration Table 52, “stream-config Properties” describes the properties you can specify using the properties editor.
Table 52. stream-config Properties
| Name | Description |
|---|---|
| Specifies the maximum number of messages that can be stored in the node’s memory while it waits to receive out-of-sequence messages. This property is used to prevent the node from running out of memory when it
detects gaps in the message stream. In general, when using a large timeout value,
set the capacity value sufficiently high to accommodate it (for example,
The default is 1000. |
| Specifies a reference to the bean that implements the ording alorithm for the custom sequence number format. For details, see Resequencer. |
| Specifies whether the resequencer ignores invalid exchanges, those for which it
cannot evaluate the specified expression. The default is
Disabled, which results in the resequencer throwing a
|
| Specifies the amount of time, in milliseconds, the node will wait to receive an out-of-sequence message before timing out. If you know the max time difference between successive messages in the stream, set the timeout to that value. Doing so guarantees that all messages in the stream will be delivered in the correct order to the next node in the route. The lower the timeout value compared to the out-of-sequence time difference, the greater the probability of out-of-sequence message delivery. The default is 1000. |