Skip to content

Commit dee5c91

Browse files
treinartembilan
authored andcommitted
Fix typos in the Reference Manual
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
1 parent 4ac3a79 commit dee5c91

File tree

8 files changed

+99
-106
lines changed

8 files changed

+99
-106
lines changed

src/reference/asciidoc/aggregator.adoc

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,11 @@ public interface ReleaseStrategy {
161161
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.
162162
This method will be invoked after the arrival of each new message, to decide whether the group is complete or not, as follows:
163163

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
173165

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
174167

168+
* the method must return true if the message group is ready for aggregation, and false otherwise.
175169

176170
For example:
177171

@@ -222,7 +216,7 @@ To avoid such situations, you should consider configuring a `MessageGroupStoreRe
222216
For information about configuring a reaper, see <<reaper>>.
223217

224218
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.
226220
As shown above, it is also the default strategy.
227221

228222
===== CorrelationStrategy
@@ -239,14 +233,14 @@ public interface CorrelationStrategy {
239233
----
240234

241235
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()`.
243237

244238
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).
245239
The method must return a value, and the value must not be `null`.
246240

247241
Spring Integration provides an out-of-the box implementation for `CorrelationStrategy`, the `HeaderAttributeCorrelationStrategy`.
248242
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.
250244
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.
251245

252246
===== LockRegistry
@@ -517,7 +511,7 @@ If the group is not released by the release strategy during timeout, then the ex
517511
Timed-out groups are either discarded, or a partial release occurs (based on `send-partial-result-on-expiry`).
518512
=====
519513

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.
521515
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:
522516
[source,xml]
523517
----
@@ -542,7 +536,6 @@ public class PojoAggregator {
542536
}
543537
return total;
544538
}
545-
546539
}
547540
----
548541

@@ -685,7 +678,6 @@ public class Waiter {
685678
public String correlateBy(OrderItem item) {
686679
...
687680
}
688-
689681
}
690682
----
691683

src/reference/asciidoc/channel.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Each is briefly described in the sections below.
6868
The `PublishSubscribeChannel` implementation broadcasts any Message sent to it to all of its subscribed handlers.
6969
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.
7070
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).
7272
Instead, any subscriber must be a `MessageHandler` itself, and the subscriber's `handleMessage(Message)` method will be invoked in turn.
7373

7474
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.
144144

145145
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).
146146
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`.
148148
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.
149149
Other strategy implementations may be added in future versions.
150150
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
254254
In fact the `SubscribableChannel` interface does not even define a `receive()` method.
255255
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.
256256
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`.
258258

259259
Spring Integration also provides an implementation of the http://eaipatterns.com/WireTap.html[Wire Tap] pattern.
260260
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:
336336
----
337337

338338
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:
340340
[source,xml]
341341
----
342342
<int:publish-subscribe-channel id="exampleChannel"/>
343343
----
344344

345-
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`).
346346

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>>).
348348
Examples of each are shown below.
349349

350350
[[channel-configuration-directchannel]]
@@ -358,7 +358,7 @@ As mentioned above, `DirectChannel` is the default type.
358358
----
359359

360360
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:
362362
[source,xml]
363363
----
364364
<int:channel id="failFastChannel">
@@ -396,7 +396,7 @@ Multiple types can be provided as a comma-delimited list:
396396
----
397397

398398
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].
400400
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.
401401

402402
You can even register custom converters.
@@ -425,9 +425,9 @@ All we need to do is implement a Converter.
425425
[source,java]
426426
----
427427
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+
}
431431
}
432432
----
433433

@@ -518,7 +518,7 @@ public BasicMessageGroupStore mongoDbChannelMessageStore(MongoDbFactory mongoDbF
518518
519519
@Bean
520520
public PollableChannel priorityQueue(BasicMessageGroupStore mongoDbChannelMessageStore) {
521-
return new QueueChannel(new MessageGroupQueue(mongoDbChannelMessageStore, "priorityQueue"));
521+
return new QueueChannel(new MessageGroupQueue(mongoDbChannelMessageStore, "priorityQueue"));
522522
}
523523
----
524524

@@ -724,7 +724,7 @@ The default value for `order` will be 0 and for `pattern`, the default is '*' (t
724724
===== Wire Tap
725725

726726
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.
728728
This is especially useful for debugging, and can be used in conjunction with Spring Integration's logging Channel Adapter as follows:
729729
[source,xml]
730730
----

src/reference/asciidoc/codec.adoc

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,18 @@ serializer that is aware of the object's structure and can directly serialize se
5858
[source,java]
5959
----
6060
public class AddressSerializer extends Serializer<Address> {
61-
@Override
62-
public void write(Kryo kryo, Output output, Address address) {
63-
output.writeString(address.getStreet());
64-
output.writeString(address.getCity());
65-
output.writeString(address.getCountry());
66-
}
67-
68-
@Override
69-
public Address read(Kryo kryo, Input input, Class<Address> type) {
70-
return new Address(input.readString(),input.readString(),input.readString());
71-
}
61+
62+
@Override
63+
public void write(Kryo kryo, Output output, Address address) {
64+
output.writeString(address.getStreet());
65+
output.writeString(address.getCity());
66+
output.writeString(address.getCountry());
67+
}
68+
69+
@Override
70+
public Address read(Kryo kryo, Input input, Class<Address> type) {
71+
return new Address(input.readString(), input.readString(), input.readString());
72+
}
7273
}
7374
----
7475

@@ -103,21 +104,21 @@ registering a custom serializer explicitly:
103104
[source,java]
104105
----
105106
public class Address implements KryoSerializable {
106-
...
107-
108-
@Override
109-
public void write(Kryo kryo, Output output) {
110-
output.writeString(this.street);
111-
output.writeString(this.city);
112-
output.writeString(this.country);
113-
}
114-
115-
@Override
116-
public void read(Kryo kryo, Input input) {
117-
this.street = input.readString();
118-
this.city = input.readString();
119-
this.country = input.readString();
120-
}
107+
...
108+
109+
@Override
110+
public void write(Kryo kryo, Output output) {
111+
output.writeString(this.street);
112+
output.writeString(this.city);
113+
output.writeString(this.country);
114+
}
115+
116+
@Override
117+
public void read(Kryo kryo, Input input) {
118+
this.street = input.readString();
119+
this.city = input.readString();
120+
this.country = input.readString();
121+
}
121122
}
122123
----
123124

0 commit comments

Comments
 (0)