Skip to content

Commit f0807fe

Browse files
warbabunartembilan
authored andcommitted
Usage clarification of the group-timeout property
Added some clarification on the usage of the group-timeout property based on discussion https://stackoverflow.com/questions/48230453/issue-with-spring-integration-aggregator-group-timeout-value * Update aggregator.adoc Fixed according to one sentence per line rule.
1 parent 8d1d0ec commit f0807fe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/reference/asciidoc/aggregator.adoc

+5-2
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ By default, an internal `DefaultLockRegistry` is used.
470470
Use of a distributed `LockRegistry`, such as the `ZookeeperLockRegistry`, ensures only one instance of the aggregator can operate on a group concurrently.
471471
See <<./redis.adoc#redis-lock-registry,Redis Lock Registry>>, <<./gemfire.adoc#gemfire-lock-registry,Gemfire Lock Registry>>, and <<./zookeeper.adoc#zk-lock-registry,Zookeeper Lock Registry>> for more information.
472472
<21> A timeout (in milliseconds) to force the `MessageGroup` complete when the `ReleaseStrategy` does not release the group when the current message arrives.
473-
This attribute provides a built-in time-based release strategy for the aggregator when there is a need to emit a partial result (or discard the group) if a new message does not arrive for the `MessageGroup` within the timeout.
473+
This attribute provides a built-in time-based release strategy for the aggregator when there is a need to emit a partial result (or discard the group) if a new message does not arrive for the `MessageGroup` within the timeout which counts from the time the last message arrived.
474+
To set up a timeout which counts from the time the `MessageGroup` was created see `group-timeout-expression` information.
474475
When a new message arrives at the aggregator, any existing `ScheduledFuture<?>` for its `MessageGroup` is canceled.
475476
If the `ReleaseStrategy` returns `false` (meaning do not release) and `groupTimeout > 0`, a new task is scheduled to expire the group.
476477
We do not advise setting this attribute to zero (or a negative value).
@@ -485,7 +486,9 @@ Used for scheduling the `MessageGroup` to be forced complete.
485486
If the expression evaluates to `null`, the completion is not scheduled.
486487
If it evaluates to zero, the group is completed immediately on the current thread.
487488
In effect, this provides a dynamic `group-timeout` property.
488-
See `group-timeout` for more information.
489+
As an example, if you wish to forcibly complete a `MessageGroup` after 10 seconds have elapsed since the time the group was created you might consider using the following SpEL expression: `timestamp + 10000 - T(System).currentTimeMillis()` where `timestamp` is provided by `MessageGroup.getTimestamp()` as the `MessageGroup` here is the `#root` evaluation context object.
490+
Bear in mind however that the group creation time might differ from the time of the first arrived message depending on other group expiration properties' configuration.
491+
See `group-timeout` for more information.
489492
Mutually exclusive with 'group-timeout' attribute.
490493
<23> When a group is completed due to a timeout (or by a `MessageGroupStoreReaper`), the group is expired (completely removed) by default.
491494
Late arriving messages start a new group.

0 commit comments

Comments
 (0)