diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 864d20a16a..9af8b6e2d0 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -80,7 +80,6 @@ task prepareDocs(type: Copy) { asciidoctorPdf { dependsOn prepareDocs - inProcess = JAVA_EXEC forkOptions { jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED' } @@ -106,7 +105,6 @@ asciidoctorPdf { asciidoctor { dependsOn asciidoctorPdf - inProcess = JAVA_EXEC forkOptions { jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED' } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcPollingChannelAdapterParserTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcPollingChannelAdapterParserTests.java index c7123a8479..905025f5b9 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcPollingChannelAdapterParserTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcPollingChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import java.util.Properties; import javax.sql.DataSource; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -177,7 +177,7 @@ public class JdbcPollingChannelAdapterParserTests { assertThat(TestUtils.getPropertyValue(autoChannelAdapter, "outputChannel")).isSameAs(autoChannel); } - @After + @AfterEach public void tearDown() { if (appCtx != null) { appCtx.close(); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcInboundChannelAdapterCommonConfig.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcInboundChannelAdapterCommonConfig.xml index 86e9177b7c..f2e7aac992 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcInboundChannelAdapterCommonConfig.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcInboundChannelAdapterCommonConfig.xml @@ -10,7 +10,9 @@ - + + + diff --git a/src/reference/asciidoc/filter.adoc b/src/reference/asciidoc/filter.adoc index 2cdbc241f6..e3432b703d 100644 --- a/src/reference/asciidoc/filter.adoc +++ b/src/reference/asciidoc/filter.adoc @@ -107,8 +107,8 @@ The following example shows how to configure a filter that uses the `method` att ---- - ==== + If the selector or adapted POJO method returns `false`, a few settings control the handling of the rejected message. By default, (if configured as in the preceding example) rejected messages are silently dropped. 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 The following example shows how to configure a filter by using annotations: +==== [source,java] ---- public class PetFilter { @@ -233,6 +234,7 @@ public class PetFilter { } } ---- +==== <1> An annotation indicating that this method is to be used as a filter. It must be specified if this class is to be used as a filter. diff --git a/src/reference/asciidoc/router.adoc b/src/reference/asciidoc/router.adoc index bcaff178be..28fbadf9e3 100644 --- a/src/reference/asciidoc/router.adoc +++ b/src/reference/asciidoc/router.adoc @@ -530,9 +530,6 @@ If you want to suppress such exceptions and send unresolved messages to the defa Normally, messages for which the header value is not explicitly mapped to a channel are sent to the `default-output-channel`. 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`. -IMPORTANT: As of Spring Integration 2.1, the attribute was changed from `ignore-channel-name-resolution-failures` to `resolution-required`. -Attribute `resolution-required` defaults to `true`. - The following example shows the equivalent router configured in Java: ==== @@ -695,6 +692,7 @@ Another convenient option when configuring a `RecipientListRouter` is to use Spr Doing so is similar to using a filter at the beginning of a 'chain' to act as a "`selective consumer`". However, in this case, it is all combined rather concisely into the router's configuration, as the following example shows: +==== [source,xml] ---- @@ -702,6 +700,7 @@ However, in this case, it is all combined rather concisely into the router's con ---- +==== 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. 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 ---- - [source,java] ---- messagingTemplate.convertAndSend(controlBus, "@'simpleRouter.handler'.addRecipient('channel2')"); @@ -803,6 +801,7 @@ someFlow() { } ---- [source, xml, role="secondary"] +.XML DSL ---- @@ -993,10 +992,12 @@ public IntegrationFlow routerFlow() { To simplify things even more, the SpEL expression may evaluate to a channel name, as the following expression shows: +==== [source,xml] ---- ---- +==== 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'. @@ -1019,7 +1020,7 @@ For further information, see: * https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#expressions-collection-selection[Collection Selection] [[router-annotation]] -===== Configuring a Router with Annotations +==== Configuring a Router with Annotations When using `@Router` to annotate a method, the method may return either a `MessageChannel` or a `String` type. 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 ==== [source,xml] ---- - + ---- ==== @@ -1214,7 +1215,7 @@ You can also use Spring's JMX support to expose a router instance and then use y NOTE: For more information about Spring Integration's JMX support, see <<./jmx.adoc#jmx,JMX Support>>. [[routing-slip]] -===== Routing Slip +==== Routing Slip Starting with version 4.1, Spring Integration provides an implementation of the https://www.enterpriseintegrationpatterns.com/RoutingTable.html[routing slip] enterprise integration pattern. 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.