Skip to content

Commit 9a7ae3d

Browse files
committed
Polishing some concerns and warnings
1 parent f3bf2a6 commit 9a7ae3d

File tree

9 files changed

+40
-31
lines changed

9 files changed

+40
-31
lines changed

src/reference/asciidoc/aggregator.adoc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ This method is invoked after the arrival of each new message, to decide whether
148148

149149
The following example shows how to use the `@ReleaseStrategy` annotation for a `List` of type `Message`:
150150

151+
====
151152
[source,java]
152153
----
153154
public class MyReleaseStrategy {
@@ -156,9 +157,11 @@ public class MyReleaseStrategy {
156157
public boolean canMessagesBeReleased(List<Message<?>>) {...}
157158
}
158159
----
160+
====
159161

160162
The following example shows how to use the `@ReleaseStrategy` annotation for a `List` of type `String`:
161163

164+
====
162165
[source,java]
163166
----
164167
public class MyReleaseStrategy {
@@ -167,6 +170,7 @@ public class MyReleaseStrategy {
167170
public boolean canMessagesBeReleased(List<String>) {...}
168171
}
169172
----
173+
====
170174

171175
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`).
172176
This satisfies the majority of use cases.
@@ -234,7 +238,7 @@ The following example shows how to configure an aggregator with the previous imp
234238
----
235239
====
236240

237-
===== CorrelationStrategy
241+
===== `CorrelationStrategy`
238242

239243
The `CorrelationStrategy` interface is defined as follows:
240244

@@ -266,7 +270,6 @@ Changes to groups are thread safe.
266270
A `LockRegistry` is used to obtain a lock for the resolved correlation ID.
267271
A `DefaultLockRegistry` is used by default (in-memory).
268272
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.
270273

271274
[[aggregator-java-dsl]]
272275
==== Configuring an Aggregator in Java DSL
@@ -346,7 +349,7 @@ Optional.
346349
<6> A reference to a `MessageGroupStore` used to store groups of messages under their correlation key until they are complete.
347350
Optional.
348351
By default, it is a volatile in-memory store.
349-
// TODO How would one change it?
352+
See "`<<message-store>>`" for more information.
350353
<7> The order of this aggregator when more than one handle is subscribed to the same `DirectChannel` (use for load-balancing purposes).
351354
Optional.
352355
<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
356359
Otherwise, by itself, this attribute does nothing.
357360
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.
358361
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`.
361363
<9> The timeout interval to wait when sending a reply `Message` to the `output-channel` or `discard-channel`.
362364
Defaults to `-1`, which results in blocking indefinitely.
363365
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
608610
====== Aggregator and Group Timeout
609611

610612
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>>`".
612614
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.
613615
For this purpose, the `groupTimeout` option lets scheduling the `MessageGroup` be forced to complete, as the following example shows:
614616

@@ -632,7 +634,7 @@ If the release strategy still does not release the group, it is expired.
632634
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`.
633635
Otherwise, it is discarded.
634636

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>>`").
636638
The reaper initiates forced completion for all `MessageGroup` s in the `MessageGroupStore` periodically.
637639
The `groupTimeout` does it for each `MessageGroup` individually if a new message does not arrive during the `groupTimeout`.
638640
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
642644

643645
The following example shows an aggregator configured with annotations:
644646

645-
===
647+
====
646648
[source,java]
647649
----
648650
public class Waiter {
@@ -680,6 +682,7 @@ The aggregator can be either referenced explicitly from XML or, if the `@Message
680682
Annotation configuration (`@Aggregator` and others) for the Aggregator component covers only simple use cases, where most default options are sufficient.
681683
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:
682684

685+
====
683686
[source,java]
684687
----
685688
@ServiceActivator(inputChannel = "aggregatorChannel")
@@ -694,6 +697,7 @@ public MessageHandler aggregator(MessageGroupStore jdbcMessageGroupStore) {
694697
return aggregator;
695698
}
696699
----
700+
====
697701

698702
See "`<<aggregator-api>>`" and "`<<annotations_on_beans>>`" for more information.
699703

src/reference/asciidoc/amqp.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,7 @@ The `org.springframework.amqp.support.AmqpHeaders` class identifies the default
13411341
* `amqp_consumerTag`
13421342
* `amqp_consumerQueue`
13431343

1344+
[[header-copy-caution]]
13441345
CAUTION: As mentioned earlier in this section, using a header mapping pattern of`*` is a common way to copy all headers.
13451346
However, this can have some unexpected side effects, because certain RabbitMQ proprietary properties/headers are also
13461347
copied.

src/reference/asciidoc/channel.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,19 +639,17 @@ If you provide a resequencer or aggregator downstream from a `PublishSubscribeCh
639639
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.
640640
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`.
641641

642-
<<<<<<< HEAD
643642
Alongside with the `Executor`, an `ErrorHandler` can be configured as well.
644643
By default the `PublishSubscribeChannel` uses a `MessagePublishingErrorHandler` implementation to send error to the `MessageChannel` from the `errorChannel` header or a global `errorChannel` instance.
645644
If an `Executor` is not configured, the `ErrorHandler` is ignored and exceptions are thrown directly to the caller's Thread.
646645

647646
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`.
648647
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.
649648
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+
651650
The following example shows how to set the `apply-sequence` header to `true`:
652651

653652
====
654-
>>>>>>> Full editing pass for the Spring Integration Reference Guide
655653
[source,xml]
656654
----
657655
<int:publish-subscribe-channel id="pubsubChannel" apply-sequence="true"/>

src/reference/asciidoc/handler-advice.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inbound-adapter->poller->http-gateway1->http-gateway2->jdbc-outbound-adapter
1313
====
1414

1515
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`.
1717

1818
Spring Integration 2.2 adds the ability to add behavior to individual endpoints.
1919
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
534534
[[handle-message-advice]]
535535
==== Handling Message Advice
536536

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).
538538
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()`).
539539
For other message handlers, the advice is applied to `MessageHandler.handleMessage()`.
540540

src/reference/asciidoc/jpa.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ Using native queries is similar to using JPA QL, except that the queries are nat
543543
By using native queries, we lose database vendor independence, which we get using JPA QL.
544544

545545
One of the things we can achieve by using native queries is to perform database inserts, which is not possible with JPA QL.
546-
(To perform inserts, we send JPA entities to the channel adapter, as <<described earlier,jpa-outbound-channel-adapter-entity-class>>).
546+
(To perform inserts, we send JPA entities to the channel adapter, as <<jpa-outbound-channel-adapter-entity-class,described earlier>>).
547547
Below is a small xml fragment that demonstrates the use of native query to insert values in a table.
548548

549549
IMPORTANT: Named parameters may not be supported by your JPA provider in conjunction with native SQL queries.

src/reference/asciidoc/preface.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[[preface]]
22
= Preface
3-
[preface]
43

54
This chapter includes:
65

src/reference/asciidoc/transactions.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
This chapter covers Spring Integration's support for transactions. It covers the following topics:
55

6-
* <<transaction-support>>
6+
* <<understanding-transaction>>
77
* <<transaction-boundaries>>
88
* <<transaction-synchronization>>
99
* <<pseudo-transactions>>
1010

11-
[[transaction-support]]
11+
[[understanding-transaction]]
1212
=== Understanding Transactions in Message flows
1313

1414
Spring Integration exposes several hooks to address the transactional needs of your message flows.

src/reference/asciidoc/whats-new.adoc

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,32 @@ If you are interested in more details, see the Issue Tracker tickets that were r
1111

1212
The following components are new in 5.1:
1313

14-
* <<AmqpDedicatedChannelAdvice>>
14+
* <<x5.1-AmqpDedicatedChannelAdvice>>
1515

16-
<<AmqpDedicatedChannelAdvice>>
16+
<<x5.1-AmqpDedicatedChannelAdvice>>
1717
==== `AmqpDedicatedChannelAdvice`
1818

1919
See <<amqp-strict-ordering>>.
2020

2121
[[x5.1-general]]
2222
=== General Changes
2323

24-
The following changes have been made in version 5.1:
24+
The following general changes have been made in version 5.1:
2525

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>>
3133

32-
[[java-dsl]]
34+
[[x5.1-java-dsl]]
3335
==== Java DSL
3436

3537
The `IntegrationFlowContext` is now an interface and `IntegrationFlowRegistration` is an inner interface of `IntegrationFlowContext`.
3638

37-
[[dispatcher-exceptions]]
39+
[[x5.1-dispatcher-exceptions]]
3840
==== Dispatcher Exceptions
3941

4042
Exceptions caught and re-thrown by `AbstractDispatcher` are now more consistent:
@@ -49,39 +51,42 @@ Previously:
4951
* Other `RuntimeException` instances were re-thrown unchanged.
5052
* Checked exceptions were wrapped in a `MessageDeliveryException` with the `failedMessage` property set.
5153

52-
[[global-channel-interceptors]]
54+
[[x5.1-global-channel-interceptors]]
5355
==== Global Channel Interceptors
5456

5557
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()`.
5658
Previously, when beans were created after the application context was refreshed, interceptors were not applied.
5759

58-
[[objecttojsontransformer]]
60+
[[x5.1-object-to-json-transformer]]
5961
==== `ObjectToJsonTransformer`
6062

6163
A new `ResultType.BYTES` mode is introduced for the `ObjectToJsonTransformer`.
6264

6365
See "`<<json-transformers>>`" for more information.
6466

65-
[[integration-flows-generated-bean-names]]
67+
[[x5.1-integration-flows-generated-bean-names]]
6668
==== Integration Flows: Generated Bean Names
6769

6870
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`.
6971

7072
See "`<<java-dsl-flows>>`" for more information.
7173

74+
[[x5.1-aggregator]]
7275
==== Aggregator Changes
7376

7477
If the `groupTimeout` is evaluated to a negative value, an aggregator now expires the group immediately.
7578
Only `null` is considered as a signal to do nothing for the current message.
7679

7780
See "`<<aggregator>>`" for more information.
7881

82+
[[x5.1-publisher]]
7983
==== @Publisher annotation changes
8084

8185
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>`.
8286

8387
See "`<<publisher-annotation>>`" for more information.
8488

89+
[[x5.1-amqp]]
8590
=== AMQP Changes
8691

8792
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
9095
The `contentType` header is now correctly mapped as an entry in the general headers map.
9196
See "`<<amqp-content-type>>`" for more information.
9297

98+
[[x5.1-jdbc]]
9399
=== JDBC Changes
94100

95101
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.
96102

97103
See "`<<jdbc>>`" for more information.
98104

105+
[[x5.1-ftp-sftp]]
99106
=== FTP and SFTP Changes
100107

101108
A `RotatingServerAdvice` is now available to poll multiple servers and directories with the inbound channel adapters.

src/reference/asciidoc/xml.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ You can define namespaces by using one of the following choices:
107107
All three options are mutually exclusive.
108108
Only one option can be set.
109109

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>>:
111111

112112
====
113113
[source,xml]

0 commit comments

Comments
 (0)