INT-4129: Add Discard Channel to Barrier Handler
JIRA: https://jira.spring.io/browse/INT-4129 Discard late arriving triggers. * Minor code style polishing Conflicts: src/reference/asciidoc/whats-new.adoc Resolved. * Fix trailing whitespaces in the `BarrierMessageHandlerTests`
This commit is contained in:
committed by
Artem Bilan
parent
51b659b6d6
commit
211647d6fe
@@ -44,6 +44,7 @@ An exception is thrown if a second thread arrives with the same correlation.
|
||||
<int:barrier id="barrier1" input-channel="in" output-channel="out"
|
||||
correlation-strategy-expression="headers['myHeader']"
|
||||
output-processor="myOutputProcessor"
|
||||
discard-channel="lateTriggerChannel"
|
||||
timeout="10000">
|
||||
</int:barrier>
|
||||
|
||||
@@ -55,6 +56,7 @@ Either the thread sending a message to `in` or the one sending a message to `rel
|
||||
up to 10 seconds until the other arrives.
|
||||
When the message is released, the `out` channel will be sent a message combining the result of invoking the
|
||||
custom `MessageGroupProcessor` bean `myOutputProcessor`.
|
||||
If the main thread times out and a trigger arrives later, you can configure a discard channel to which the late trigger will be sent.
|
||||
Java configuration is shown below.
|
||||
|
||||
[source, java]
|
||||
@@ -68,6 +70,7 @@ public class Config {
|
||||
public BarrierMessageHandler barrier() {
|
||||
BarrierMessageHandler barrier = new BarrierMessageHandler(10000);
|
||||
barrier.setOutputChannel(out());
|
||||
barrier.setDiscardChannel(lateTriggers());
|
||||
return barrier;
|
||||
}
|
||||
|
||||
|
||||
@@ -290,3 +290,8 @@ See <<jdbc-message-store-channels>> for more information.
|
||||
|
||||
The `ServerWebSocketContainer` now exposes `allowedOrigins` option and `SockJsServiceOptions` a `suppressCors` option.
|
||||
See <<web-sockets>> for more information.
|
||||
|
||||
==== Barrier Changes
|
||||
|
||||
The `BarrierMessageHandler` now supports a discard channel to which late-arriving trigger messages are sent.
|
||||
See <<barrier>> for more information.
|
||||
|
||||
Reference in New Issue
Block a user