Skip to content

Commit 7655d97

Browse files
committed
Fix code typos in filter.adoc & router.adoc
* Fix race condition in the `JdbcPollingChannelAdapterParserTests` making SELECT and UPDATE as a part of the same transaction * Remove `inProcess = JAVA_EXEC` from ASCIIDoc Gradle tasks in attempt to make them working in parallel
1 parent 0cf81db commit 7655d97

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

gradle/docs.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ task prepareDocs(type: Copy) {
8080
asciidoctorPdf {
8181
dependsOn prepareDocs
8282

83-
inProcess = JAVA_EXEC
8483
forkOptions {
8584
jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED'
8685
}
@@ -106,7 +105,6 @@ asciidoctorPdf {
106105
asciidoctor {
107106
dependsOn asciidoctorPdf
108107

109-
inProcess = JAVA_EXEC
110108
forkOptions {
111109
jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED'
112110
}

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcPollingChannelAdapterParserTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@
2222

2323
import javax.sql.DataSource;
2424

25-
import org.junit.After;
26-
import org.junit.Test;
25+
import org.junit.jupiter.api.AfterEach;
26+
import org.junit.jupiter.api.Test;
2727

2828
import org.springframework.context.ConfigurableApplicationContext;
2929
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -177,7 +177,7 @@ public void testAutoChannel() {
177177
assertThat(TestUtils.getPropertyValue(autoChannelAdapter, "outputChannel")).isSameAs(autoChannel);
178178
}
179179

180-
@After
180+
@AfterEach
181181
public void tearDown() {
182182
if (appCtx != null) {
183183
appCtx.close();

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcInboundChannelAdapterCommonConfig.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<si:queue />
1111
</si:channel>
1212

13-
<si:poller default="true" fixed-delay="100"/>
13+
<si:poller default="true" fixed-delay="100">
14+
<si:transactional/>
15+
</si:poller>
1416

1517
<jdbc:embedded-database type="HSQL" id="dataSource">
1618
<jdbc:script location="org/springframework/integration/jdbc/config/inboundSchema.sql" />

src/reference/asciidoc/filter.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ The following example shows how to configure a filter that uses the `method` att
107107
108108
<bean id="exampleObject" class="example.SomeObject"/>
109109
----
110-
111110
====
111+
112112
If the selector or adapted POJO method returns `false`, a few settings control the handling of the rejected message.
113113
By default, (if configured as in the preceding example) rejected messages are silently dropped.
114114
If rejection should instead result in an error condition, set the `throw-exception-on-rejection` attribute to `true`, as the following example shows:
@@ -223,6 +223,7 @@ However, the underlying functionality of evaluating the expression against the m
223223

224224
The following example shows how to configure a filter by using annotations:
225225

226+
====
226227
[source,java]
227228
----
228229
public class PetFilter {
@@ -233,6 +234,7 @@ public class PetFilter {
233234
}
234235
}
235236
----
237+
====
236238

237239
<1> An annotation indicating that this method is to be used as a filter.
238240
It must be specified if this class is to be used as a filter.

src/reference/asciidoc/router.adoc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,6 @@ If you want to suppress such exceptions and send unresolved messages to the defa
530530
Normally, messages for which the header value is not explicitly mapped to a channel are sent to the `default-output-channel`.
531531
However, when the header value is mapped to a channel name but the channel cannot be resolved, setting the `resolution-required` attribute to `false` results in routing such messages to the `default-output-channel`.
532532

533-
IMPORTANT: As of Spring Integration 2.1, the attribute was changed from `ignore-channel-name-resolution-failures` to `resolution-required`.
534-
Attribute `resolution-required` defaults to `true`.
535-
536533
The following example shows the equivalent router configured in Java:
537534

538535
====
@@ -695,13 +692,15 @@ Another convenient option when configuring a `RecipientListRouter` is to use Spr
695692
Doing so is similar to using a filter at the beginning of a 'chain' to act as a "`selective consumer`".
696693
However, in this case, it is all combined rather concisely into the router's configuration, as the following example shows:
697694

695+
====
698696
[source,xml]
699697
----
700698
<int:recipient-list-router id="customRouter" input-channel="routingChannel">
701699
<int:recipient channel="channel1" selector-expression="payload.equals('foo')"/>
702700
<int:recipient channel="channel2" selector-expression="headers.containsKey('bar')"/>
703701
</int:recipient-list-router>
704702
----
703+
====
705704

706705
In the preceding configuration, a SpEL expression identified by the `selector-expression` attribute is evaluated to determine whether this recipient should be included in the recipient list for a given input message.
707706
The evaluation result of the expression must be a `boolean`.
@@ -725,7 +724,6 @@ They are available by using <<./control-bus.adoc#control-bus,Control Bus>> as we
725724
726725
<channel id="channel2"/>
727726
----
728-
729727
[source,java]
730728
----
731729
messagingTemplate.convertAndSend(controlBus, "@'simpleRouter.handler'.addRecipient('channel2')");
@@ -803,6 +801,7 @@ someFlow() {
803801
}
804802
----
805803
[source, xml, role="secondary"]
804+
.XML DSL
806805
----
807806
<int:exception-type-router input-channel="inputChannel"
808807
default-output-channel="defaultChannel">
@@ -993,10 +992,12 @@ public IntegrationFlow routerFlow() {
993992

994993
To simplify things even more, the SpEL expression may evaluate to a channel name, as the following expression shows:
995994

995+
====
996996
[source,xml]
997997
----
998998
<int:router input-channel="inChannel" expression="payload + 'Channel'"/>
999999
----
1000+
====
10001001

10011002
In the preceding configuration, the result channel is computed by the SpEL expression, which concatenates the value of the `payload` with the literal `String`, 'Channel'.
10021003

@@ -1019,7 +1020,7 @@ For further information, see:
10191020
* https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#expressions-collection-selection[Collection Selection]
10201021

10211022
[[router-annotation]]
1022-
===== Configuring a Router with Annotations
1023+
==== Configuring a Router with Annotations
10231024

10241025
When using `@Router` to annotate a method, the method may return either a `MessageChannel` or a `String` type.
10251026
In the latter case, the endpoint resolves the channel name as it does for the default output channel.
@@ -1135,7 +1136,7 @@ However, if you look at the alternate configuration of the `HeaderValueRouter` w
11351136
====
11361137
[source,xml]
11371138
----
1138-
<int:header-value-router input-channel="inputChannel" header-name="testHeader">
1139+
<int:header-value-router input-channel="inputChannel" header-name="testHeader"/>
11391140
----
11401141
====
11411142

@@ -1214,7 +1215,7 @@ You can also use Spring's JMX support to expose a router instance and then use y
12141215
NOTE: For more information about Spring Integration's JMX support, see <<./jmx.adoc#jmx,JMX Support>>.
12151216

12161217
[[routing-slip]]
1217-
===== Routing Slip
1218+
==== Routing Slip
12181219

12191220
Starting with version 4.1, Spring Integration provides an implementation of the https://www.enterpriseintegrationpatterns.com/RoutingTable.html[routing slip] enterprise integration pattern.
12201221
It is implemented as a `routingSlip` message header, which is used to determine the next channel in `AbstractMessageProducingHandler` instances, when an `outputChannel` is not specified for the endpoint.

0 commit comments

Comments
 (0)