You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reference/asciidoc/aggregator.adoc
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,7 @@ This method is invoked after the arrival of each new message, to decide whether
148
148
149
149
The following example shows how to use the `@ReleaseStrategy` annotation for a `List` of type `Message`:
150
150
151
+
====
151
152
[source,java]
152
153
----
153
154
public class MyReleaseStrategy {
@@ -156,9 +157,11 @@ public class MyReleaseStrategy {
156
157
public boolean canMessagesBeReleased(List<Message<?>>) {...}
157
158
}
158
159
----
160
+
====
159
161
160
162
The following example shows how to use the `@ReleaseStrategy` annotation for a `List` of type `String`:
161
163
164
+
====
162
165
[source,java]
163
166
----
164
167
public class MyReleaseStrategy {
@@ -167,6 +170,7 @@ public class MyReleaseStrategy {
167
170
public boolean canMessagesBeReleased(List<String>) {...}
168
171
}
169
172
----
173
+
====
170
174
171
175
Based on the signatures in the preceding two examples, the POJO-based release strategy is passed a `Collection` of not-yet-released messages (if you need access to the whole `Message`) or a `Collection` of payload objects (if the type parameter is anything other than `Message`).
172
176
This satisfies the majority of use cases.
@@ -234,7 +238,7 @@ The following example shows how to configure an aggregator with the previous imp
234
238
----
235
239
====
236
240
237
-
===== CorrelationStrategy
241
+
===== `CorrelationStrategy`
238
242
239
243
The `CorrelationStrategy` interface is defined as follows:
240
244
@@ -266,7 +270,6 @@ Changes to groups are thread safe.
266
270
A `LockRegistry` is used to obtain a lock for the resolved correlation ID.
267
271
A `DefaultLockRegistry` is used by default (in-memory).
268
272
For synchronizing updates across servers, where a shared `MessageGroupStore` is being used, you must configure a shared lock registry.
269
-
See "`<<aggregator>>`" for more information.
270
273
271
274
[[aggregator-java-dsl]]
272
275
==== Configuring an Aggregator in Java DSL
@@ -346,7 +349,7 @@ Optional.
346
349
<6> A reference to a `MessageGroupStore` used to store groups of messages under their correlation key until they are complete.
347
350
Optional.
348
351
By default, it is a volatile in-memory store.
349
-
// TODO How would one change it?
352
+
See "`<<message-store>>`" for more information.
350
353
<7> The order of this aggregator when more than one handle is subscribed to the same `DirectChannel` (use for load-balancing purposes).
351
354
Optional.
352
355
<8> Indicates that expired messages should be aggregated and sent to the 'output-channel' or 'replyChannel' once their containing `MessageGroup` is expired (see https://docs.spring.io/spring-integration/api/org/springframework/integration/store/MessageGroupStore.html#expireMessageGroups-long[`MessageGroupStore.expireMessageGroups(long)`]).
@@ -356,8 +359,7 @@ You can accomplish that through a Control Bus operation or, if you have a refere
356
359
Otherwise, by itself, this attribute does nothing.
357
360
It serves only as an indicator of whether to discard or send to the output or reply channel any messages that are still in the `MessageGroup` that is about to be expired.
358
361
Optional (the default is `false`).
359
-
NOTE: This attribute might more properly be called `send-partial-result-on-timeout`, because the group may not actually expire if
360
-
`expire-groups-upon-timeout` is set to `false`.
362
+
NOTE: This attribute might more properly be called `send-partial-result-on-timeout`, because the group may not actually expire if `expire-groups-upon-timeout` is set to `false`.
361
363
<9> The timeout interval to wait when sending a reply `Message` to the `output-channel` or `discard-channel`.
362
364
Defaults to `-1`, which results in blocking indefinitely.
363
365
It is applied only if the output channel has some 'sending' limitations, such as a `QueueChannel` with a fixed 'capacity'.
@@ -608,7 +610,7 @@ In the preceding example, the root object of the SpEL evaluation context is the
608
610
====== Aggregator and Group Timeout
609
611
610
612
Starting with version 4.0, two new mutually exclusive attributes have been introduced: `group-timeout` and `group-timeout-expression` (see the earlier description).
611
-
// TODO This needs a link, but I don't see a target for it.
613
+
See "`<<aggregator-xml>>`".
612
614
In some cases, you may need to emit the aggregator result (or discard the group) after a timeout if the `ReleaseStrategy` does not release when the current message arrives.
613
615
For this purpose, the `groupTimeout` option lets scheduling the `MessageGroup` be forced to complete, as the following example shows:
614
616
@@ -632,7 +634,7 @@ If the release strategy still does not release the group, it is expired.
632
634
If `send-partial-result-on-expiry` is `true`, existing messages in the (partial) `MessageGroup` are released as a normal aggregator reply message to the `output-channel`.
633
635
Otherwise, it is discarded.
634
636
635
-
There is a difference between `groupTimeout` behavior and `MessageGroupStoreReaper` (see "`<<aggregator-config>>`").
637
+
There is a difference between `groupTimeout` behavior and `MessageGroupStoreReaper` (see "`<<aggregator-xml>>`").
636
638
The reaper initiates forced completion for all `MessageGroup` s in the `MessageGroupStore` periodically.
637
639
The `groupTimeout` does it for each `MessageGroup` individually if a new message does not arrive during the `groupTimeout`.
638
640
Also, the reaper can be used to remove empty groups (empty groups are retained in order to discard late messages if `expire-groups-upon-completion` is false).
@@ -642,7 +644,7 @@ Also, the reaper can be used to remove empty groups (empty groups are retained i
642
644
643
645
The following example shows an aggregator configured with annotations:
644
646
645
-
===
647
+
====
646
648
[source,java]
647
649
----
648
650
public class Waiter {
@@ -680,6 +682,7 @@ The aggregator can be either referenced explicitly from XML or, if the `@Message
680
682
Annotation configuration (`@Aggregator` and others) for the Aggregator component covers only simple use cases, where most default options are sufficient.
681
683
If you need more control over those options when using annotation configuration, consider using a `@Bean` definition for the `AggregatingMessageHandler` and mark its `@Bean` method with `@ServiceActivator`, as the following example shows:
Copy file name to clipboardExpand all lines: src/reference/asciidoc/channel.adoc
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -639,19 +639,17 @@ If you provide a resequencer or aggregator downstream from a `PublishSubscribeCh
639
639
Doing so indicates that the channel should set the `sequence-size` and `sequence-number` message headers as well as the correlation ID prior to passing along the messages.
640
640
For example, if there are five subscribers, the `sequence-size` would be set to `5`, and the messages would have `sequence-number` header values ranging from `1` to `5`.
641
641
642
-
<<<<<<< HEAD
643
642
Alongside with the `Executor`, an `ErrorHandler` can be configured as well.
644
643
By default the `PublishSubscribeChannel` uses a `MessagePublishingErrorHandler` implementation to send error to the `MessageChannel` from the `errorChannel` header or a global `errorChannel` instance.
645
644
If an `Executor` is not configured, the `ErrorHandler` is ignored and exceptions are thrown directly to the caller's Thread.
646
645
647
646
If you are providing a _Resequencer_ or _Aggregator_ downstream from a `PublishSubscribeChannel`, then you can set the 'apply-sequence' property on the channel to `true`.
648
647
That will indicate that the channel should set the sequence-size and sequence-number Message headers as well as the correlation id prior to passing the Messages along.
649
648
For example, if there are 5 subscribers, the sequence-size would be set to 5, and the Messages would have sequence-number header values ranging from 1 to 5.
650
-
=======
649
+
651
650
The following example shows how to set the `apply-sequence` header to `true`:
652
651
653
652
====
654
-
>>>>>>> Full editing pass for the Spring Integration Reference Guide
If you configure some retry-logic into an advice chain on the poller and the call to `http-gateway2` failed because of a network glitch, the retry causes both `http-gateway1` and `http-gateway2` to be called a second time.
16
-
Similarly, after a transient failure in the jdbc-outbound-adapter, both HTTP gateways aree called a second time before again calling the `jdbc-outbound-adapter`.
16
+
Similarly, after a transient failure in the jdbc-outbound-adapter, both HTTP gateways are called a second time before again calling the `jdbc-outbound-adapter`.
17
17
18
18
Spring Integration 2.2 adds the ability to add behavior to individual endpoints.
19
19
This is achieved by the addition of the `<request-handler-advice-chain/>` element to many endpoints.
@@ -534,7 +534,7 @@ While the abstract class mentioned above is a convenience, you can add any `Advi
534
534
[[handle-message-advice]]
535
535
==== Handling Message Advice
536
536
537
-
As discussed in <<mhac-intro, the introduction to this section>>, advice objects in a request handler advice chain are applied to just the current endpoint, not the downstream flow (if any).
537
+
As discussed in <<message-handler-advice-chain, the introduction to this section>>, advice objects in a request handler advice chain are applied to just the current endpoint, not the downstream flow (if any).
538
538
For `MessageHandler` objects that produce a reply (such as those that extend `AbstractReplyProducingMessageHandler`), the advice is applied to an internal method: `handleRequestMessage()` (called from `MessageHandler.handleMessage()`).
539
539
For other message handlers, the advice is applied to `MessageHandler.handleMessage()`.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/whats-new.adoc
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,30 +11,32 @@ If you are interested in more details, see the Issue Tracker tickets that were r
11
11
12
12
The following components are new in 5.1:
13
13
14
-
* <<AmqpDedicatedChannelAdvice>>
14
+
* <<x5.1-AmqpDedicatedChannelAdvice>>
15
15
16
-
<<AmqpDedicatedChannelAdvice>>
16
+
<<x5.1-AmqpDedicatedChannelAdvice>>
17
17
==== `AmqpDedicatedChannelAdvice`
18
18
19
19
See <<amqp-strict-ordering>>.
20
20
21
21
[[x5.1-general]]
22
22
=== General Changes
23
23
24
-
The following changes have been made in version 5.1:
24
+
The following general changes have been made in version 5.1:
25
25
26
-
* <<java-dsl>>
27
-
* <<dispatcher-exceptions>>
28
-
* <<global-channel-interceptors>>
29
-
* <<objecttojsontransformer>>
30
-
* <<integration-flows-generated-bean-names>>
26
+
* <<x5.1-java-dsl>>
27
+
* <<x5.1-dispatcher-exceptions>>
28
+
* <<x5.1-global-channel-interceptors>>
29
+
* <<x5.1-object-to-json-transformer>>
30
+
* <<x5.1-integration-flows-generated-bean-names>>
31
+
* <<x5.1-aggregator>>
32
+
* <<x5.1-publisher>>
31
33
32
-
[[java-dsl]]
34
+
[[x5.1-java-dsl]]
33
35
==== Java DSL
34
36
35
37
The `IntegrationFlowContext` is now an interface and `IntegrationFlowRegistration` is an inner interface of `IntegrationFlowContext`.
36
38
37
-
[[dispatcher-exceptions]]
39
+
[[x5.1-dispatcher-exceptions]]
38
40
==== Dispatcher Exceptions
39
41
40
42
Exceptions caught and re-thrown by `AbstractDispatcher` are now more consistent:
@@ -49,39 +51,42 @@ Previously:
49
51
* Other `RuntimeException` instances were re-thrown unchanged.
50
52
* Checked exceptions were wrapped in a `MessageDeliveryException` with the `failedMessage` property set.
51
53
52
-
[[global-channel-interceptors]]
54
+
[[x5.1-global-channel-interceptors]]
53
55
==== Global Channel Interceptors
54
56
55
57
Global channel interceptors now apply to dynamically registered channels, such as through the `IntegrationFlowContext` when using the Java DSL or beans that are initialized using `beanFactory.initializeBean()`.
56
58
Previously, when beans were created after the application context was refreshed, interceptors were not applied.
57
59
58
-
[[objecttojsontransformer]]
60
+
[[x5.1-object-to-json-transformer]]
59
61
==== `ObjectToJsonTransformer`
60
62
61
63
A new `ResultType.BYTES` mode is introduced for the `ObjectToJsonTransformer`.
62
64
63
65
See "`<<json-transformers>>`" for more information.
64
66
65
-
[[integration-flows-generated-bean-names]]
67
+
[[x5.1-integration-flows-generated-bean-names]]
66
68
==== Integration Flows: Generated Bean Names
67
69
68
70
Starting with version 5.0.5, generated bean names for the components in an `IntegrationFlow` include the flow bean name, followed by a dot, as a prefix. For example, if a flow bean were named `flowBean`, a generated bean might be named `flowBean.generatedBean`.
69
71
70
72
See "`<<java-dsl-flows>>`" for more information.
71
73
74
+
[[x5.1-aggregator]]
72
75
==== Aggregator Changes
73
76
74
77
If the `groupTimeout` is evaluated to a negative value, an aggregator now expires the group immediately.
75
78
Only `null` is considered as a signal to do nothing for the current message.
76
79
77
80
See "`<<aggregator>>`" for more information.
78
81
82
+
[[x5.1-publisher]]
79
83
==== @Publisher annotation changes
80
84
81
85
Starting with version 5.1, you must explicitly turn on the `@Publisher` AOP functionality by using `@EnablePublisher` or by using the `<int:enable-publisher>` child element on `<int:annotation-config>`.
82
86
83
87
See "`<<publisher-annotation>>`" for more information.
84
88
89
+
[[x5.1-amqp]]
85
90
=== AMQP Changes
86
91
87
92
We have made `ID` and `Timestamp` header mapping changes in the `DefaultAmqpHeaderMapper`.
@@ -90,12 +95,14 @@ See the note near the bottom of "`<<amqp-message-headers>>`" for more informatio
90
95
The `contentType` header is now correctly mapped as an entry in the general headers map.
91
96
See "`<<amqp-content-type>>`" for more information.
92
97
98
+
[[x5.1-jdbc]]
93
99
=== JDBC Changes
94
100
95
101
A confusing `max-rows-per-poll` property on the JDBC Inbound Channel Adapter and JDBC Outbound Gateway has been deprecated in favor of the newly introduced `max-rows` property.
96
102
97
103
See "`<<jdbc>>`" for more information.
98
104
105
+
[[x5.1-ftp-sftp]]
99
106
=== FTP and SFTP Changes
100
107
101
108
A `RotatingServerAdvice` is now available to poll multiple servers and directories with the inbound channel adapters.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/xml.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ You can define namespaces by using one of the following choices:
107
107
All three options are mutually exclusive.
108
108
Only one option can be set.
109
109
110
-
The following example shows several different ways to use XPath expressions, including the options for setting the XML namespaces <<mentioned earlier,xpath-namespace-support>>:
110
+
The following example shows several different ways to use XPath expressions, including the options for setting the XML namespaces <<xpath-namespace-support,mentioned earlier>>:
0 commit comments