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
Update note on channel interceptors in docs
Update `channel.adoc` including `afterReceiveCompletion(..)` in the
list of methods that are not invoked when an interceptor is applied
to `PollableChannel`
Improve `aggregator.adoc` formatting in docs
Fix and improve `channel.adoc` formatting in docs
Convert tabs to spaces of `codec.adoc` in docs
Convert tabs to spaces and fix formatting of `content-enrichment.adoc` in docs
Convert tabs to spaces and fix formatting of `logging-adapter.adoc` in docs
Convert tabs to spaces on `metrics.adoc` in docs
Improve `resequencer.adoc` formatting in docs
Improve `splitter.adoc` formatting in docs
* Fix more typos in the Reference Manual
Copy file name to clipboardExpand all lines: src/reference/asciidoc/aggregator.adoc
+7-15Lines changed: 7 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,17 +161,11 @@ public interface ReleaseStrategy {
161
161
In general, any POJO can implement the completion decision logic if it provides a method that accepts a single `java.util.List` as an argument (parameterized lists are supported as well), and returns a boolean value.
162
162
This method will be invoked after the arrival of each new message, to decide whether the group is complete or not, as follows:
163
163
164
-
if the argument is a `java.util.List<T>`, and the parameter type T is assignable to `Message`, then the whole list of messages accumulated in the group will be sent to the method
165
-
166
-
167
-
168
-
if the argument is a non-parametrized `java.util.List` or the parameter type is not assignable to `Message`, then the method will receive the payloads of the accumulated messages
169
-
170
-
171
-
172
-
the method must return true if the message group is ready for aggregation, and false otherwise.
164
+
* if the argument is a `java.util.List<T>`, and the parameter type T is assignable to `Message`, then the whole list of messages accumulated in the group will be sent to the method
173
165
166
+
* if the argument is a non-parametrized `java.util.List` or the parameter type is not assignable to `Message`, then the method will receive the payloads of the accumulated messages
174
167
168
+
* the method must return true if the message group is ready for aggregation, and false otherwise.
175
169
176
170
For example:
177
171
@@ -222,7 +216,7 @@ To avoid such situations, you should consider configuring a `MessageGroupStoreRe
222
216
For information about configuring a reaper, see <<reaper>>.
223
217
224
218
Spring Integration provides an out-of-the box implementation for `ReleaseStrategy`, the `SequenceSizeReleaseStrategy`.
225
-
This implementation consults the SEQUENCE_NUMBER and SEQUENCE_SIZE headers of each arriving message to decide when a message group is complete and ready to be aggregated.
219
+
This implementation consults the `SEQUENCE_NUMBER` and `SEQUENCE_SIZE` headers of each arriving message to decide when a message group is complete and ready to be aggregated.
226
220
As shown above, it is also the default strategy.
227
221
228
222
===== CorrelationStrategy
@@ -239,14 +233,14 @@ public interface CorrelationStrategy {
239
233
----
240
234
241
235
The method returns an Object which represents the correlation key used for associating the message with a message group.
242
-
The key must satisfy the criteria used for a key in a Map with respect to the implementation of equals() and hashCode().
236
+
The key must satisfy the criteria used for a key in a Map with respect to the implementation of `equals()` and `hashCode()`.
243
237
244
238
In general, any POJO can implement the correlation logic, and the rules for mapping a message to a method's argument (or arguments) are the same as for a `ServiceActivator` (including support for @Header annotations).
245
239
The method must return a value, and the value must not be `null`.
246
240
247
241
Spring Integration provides an out-of-the box implementation for `CorrelationStrategy`, the `HeaderAttributeCorrelationStrategy`.
248
242
This implementation returns the value of one of the message headers (whose name is specified by a constructor argument) as the correlation key.
249
-
By default, the correlation strategy is a `HeaderAttributeCorrelationStrategy` returning the value of the CORRELATION_ID header attribute.
243
+
By default, the correlation strategy is a `HeaderAttributeCorrelationStrategy` returning the value of the `CORRELATION_ID` header attribute.
250
244
If you have a custom header name you would like to use for correlation, then simply configure that on an instance of `HeaderAttributeCorrelationStrategy` and provide that as a reference for the Aggregator's correlation-strategy.
251
245
252
246
===== LockRegistry
@@ -517,7 +511,7 @@ If the group is not released by the release strategy during timeout, then the ex
517
511
Timed-out groups are either discarded, or a partial release occurs (based on `send-partial-result-on-expiry`).
518
512
=====
519
513
520
-
Using a `ref` attribute is generally recommended if a custom aggregator handler implementation may be referenced in other`<aggregator>` definitions.
514
+
Using a `ref` attribute is generally recommended if a custom aggregator handler implementation may be referenced in other`<aggregator>` definitions.
521
515
However if a custom aggregator implementation is only being used by a single definition of the `<aggregator>`, you can use an inner bean definition (starting with version 1.0.3) to configure the aggregation POJO within the `<aggregator>` element:
Copy file name to clipboardExpand all lines: src/reference/asciidoc/channel.adoc
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ Each is briefly described in the sections below.
68
68
The `PublishSubscribeChannel` implementation broadcasts any Message sent to it to all of its subscribed handlers.
69
69
This is most often used for sending _Event Messages_ whose primary role is notification as opposed to _Document Messages_ which are generally intended to be processed by a single handler.
70
70
Note that the `PublishSubscribeChannel` is intended for sending only.
71
-
Since it broadcasts to its subscribers directly when its` send(Message)` method is invoked, consumers cannot poll for Messages (it does not implement `PollableChannel` and therefore has no `receive()` method).
71
+
Since it broadcasts to its subscribers directly when its `send(Message)` method is invoked, consumers cannot poll for Messages (it does not implement `PollableChannel` and therefore has no `receive()` method).
72
72
Instead, any subscriber must be a `MessageHandler` itself, and the subscriber's `handleMessage(Message)` method will be invoked in turn.
73
73
74
74
Prior to version 3.0, invoking the send method on a `PublishSubscribeChannel` that had no subscribers returned `false`.
@@ -144,7 +144,7 @@ Below you will see how each of these can be configured.
144
144
145
145
The `DirectChannel` internally delegates to a Message Dispatcher to invoke its subscribed Message Handlers, and that dispatcher can have a load-balancing strategy exposed via _load-balancer_ or _load-balancer-ref_ attributes (mutually exclusive).
146
146
The load balancing strategy is used by the Message Dispatcher to help determine how Messages are distributed amongst Message Handlers in the case that there are multiple Message Handlers subscribed to the same channel.
147
-
As a convinience the _load-balancer_ attribute exposes enumeration of values pointing to pre-existing implementations of `LoadBalancingStrategy`.
147
+
As a convenience the _load-balancer_ attribute exposes enumeration of values pointing to pre-existing implementations of `LoadBalancingStrategy`.
148
148
The "round-robin" (load-balances across the handlers in rotation) and "none" (for the cases where one wants to explicitely disable load balancing) are the only available values.
149
149
Other strategy implementations may be added in future versions.
150
150
However, since version 3.0 you can provide your own implementation of the `LoadBalancingStrategy` and inject it using _load-balancer-ref_ attribute which should point to a bean that implements `LoadBalancingStrategy`.
@@ -254,7 +254,7 @@ NOTE: Keep in mind that `receive()` calls are only relevant for `PollableChannel
254
254
In fact the `SubscribableChannel` interface does not even define a `receive()` method.
255
255
The reason for this is that when a Message is sent to a `SubscribableChannel` it will be sent directly to one or more subscribers depending on the type of channel (e.g.
256
256
a PublishSubscribeChannel sends to all of its subscribers).
257
-
Therefore, the `preReceive(..)`and `postReceive(..)` interceptor methods are only invoked when the interceptor is applied to a `PollableChannel`.
257
+
Therefore, the `preReceive(..)`, `postReceive(..)` and `afterReceiveCompletion(..)` interceptor methods are only invoked when the interceptor is applied to a `PollableChannel`.
258
258
259
259
Spring Integration also provides an implementation of the http://eaipatterns.com/WireTap.html[Wire Tap] pattern.
260
260
It is a simple interceptor that sends the Message to another channel without otherwise altering the existing flow.
@@ -336,15 +336,15 @@ To create a Message Channel instance, you can use the <channel/> element:
336
336
----
337
337
338
338
The default channel type is _Point to Point_.
339
-
To create a _Publish Subscribe_ channel, use the <publish-subscribe-channel/> element:
339
+
To create a _Publish Subscribe_ channel, use the `<publish-subscribe-channel/>` element:
When using the <channel/> element without any sub-elements, it will create a `DirectChannel` instance (a `SubscribableChannel`).
345
+
When using the `<channel/>` element without any sub-elements, it will create a `DirectChannel` instance (a `SubscribableChannel`).
346
346
347
-
However, you can alternatively provide a variety of <queue/> sub-elements to create any of the pollable channel types (as described in<<channel-implementations>>).
347
+
However, you can alternatively provide a variety of `<queue/>` sub-elements to create any of the pollable channel types (as described in<<channel-implementations>>).
348
348
Examples of each are shown below.
349
349
350
350
[[channel-configuration-directchannel]]
@@ -358,7 +358,7 @@ As mentioned above, `DirectChannel` is the default type.
358
358
----
359
359
360
360
A default channel will have a _round-robin_ load-balancer and will also have failover enabled (See the discussion in <<channel-implementations-directchannel>> for more detail).
361
-
To disable one or both of these, add a <dispatcher/> sub-element and configure the attributes:
361
+
To disable one or both of these, add a `<dispatcher/>` sub-element and configure the attributes:
362
362
[source,xml]
363
363
----
364
364
<int:channel id="failFastChannel">
@@ -396,7 +396,7 @@ Multiple types can be provided as a comma-delimited list:
396
396
----
397
397
398
398
So the 'numberChannel' above will only accept Messages with a data-type of `java.lang.Number`.
399
-
But what happens if the payload of the Message is not of the required type? It depends on whether you have defined a bean named "integrationConversionService" that is an instance of Spring's http://static.springsource.org/spring/docs/current/spring-framework-reference/html/validation.html#core-convert-ConversionService-API[Conversion Service].
399
+
But what happens if the payload of the Message is not of the required type? It depends on whether you have defined a bean named `integrationConversionService` that is an instance of Spring's http://static.springsource.org/spring/docs/current/spring-framework-reference/html/validation.html#core-convert-ConversionService-API[Conversion Service].
400
400
If not, then an Exception would be thrown immediately, but if you do have an "integrationConversionService" bean defined, it will be used in an attempt to convert the Message's payload to the acceptable type.
401
401
402
402
You can even register custom converters.
@@ -425,9 +425,9 @@ All we need to do is implement a Converter.
425
425
[source,java]
426
426
----
427
427
public static class StringToIntegerConverter implements Converter<String, Integer> {
428
-
public Integer convert(String source) {
429
-
return Integer.parseInt(source);
430
-
}
428
+
public Integer convert(String source) {
429
+
return Integer.parseInt(source);
430
+
}
431
431
}
432
432
----
433
433
@@ -518,7 +518,7 @@ public BasicMessageGroupStore mongoDbChannelMessageStore(MongoDbFactory mongoDbF
518
518
519
519
@Bean
520
520
public PollableChannel priorityQueue(BasicMessageGroupStore mongoDbChannelMessageStore) {
521
-
return new QueueChannel(new MessageGroupQueue(mongoDbChannelMessageStore, "priorityQueue"));
521
+
return new QueueChannel(new MessageGroupQueue(mongoDbChannelMessageStore, "priorityQueue"));
522
522
}
523
523
----
524
524
@@ -724,7 +724,7 @@ The default value for `order` will be 0 and for `pattern`, the default is '*' (t
724
724
===== Wire Tap
725
725
726
726
As mentioned above, Spring Integration provides a simple _Wire Tap_ interceptor out of the box.
727
-
You can configure a _Wire Tap_ on any channel within an <interceptors/> element.
727
+
You can configure a _Wire Tap_ on any channel within an `<interceptors/>` element.
728
728
This is especially useful for debugging, and can be used in conjunction with Spring Integration's logging Channel Adapter as follows:
0 commit comments