Merge branch '6.1.x'

# Conflicts:
#	framework-platform/framework-platform.gradle
This commit is contained in:
Juergen Hoeller 2024-06-05 00:02:33 +02:00
commit a26d31ee3a
3 changed files with 32 additions and 19 deletions

View File

@ -9,15 +9,15 @@ javaPlatform {
dependencies { dependencies {
api(platform("com.fasterxml.jackson:jackson-bom:2.15.4")) api(platform("com.fasterxml.jackson:jackson-bom:2.15.4"))
api(platform("io.micrometer:micrometer-bom:1.13.0")) api(platform("io.micrometer:micrometer-bom:1.13.0"))
api(platform("io.netty:netty-bom:4.1.109.Final")) api(platform("io.netty:netty-bom:4.1.110.Final"))
api(platform("io.netty:netty5-bom:5.0.0.Alpha5")) api(platform("io.netty:netty5-bom:5.0.0.Alpha5"))
api(platform("io.projectreactor:reactor-bom:2024.0.0-M2")) api(platform("io.projectreactor:reactor-bom:2024.0.0-M2"))
api(platform("io.rsocket:rsocket-bom:1.1.3")) api(platform("io.rsocket:rsocket-bom:1.1.3"))
api(platform("org.apache.groovy:groovy-bom:4.0.21")) api(platform("org.apache.groovy:groovy-bom:4.0.21"))
api(platform("org.apache.logging.log4j:log4j-bom:2.21.1")) api(platform("org.apache.logging.log4j:log4j-bom:2.21.1"))
api(platform("org.assertj:assertj-bom:3.26.0")) api(platform("org.assertj:assertj-bom:3.26.0"))
api(platform("org.eclipse.jetty:jetty-bom:12.0.9")) api(platform("org.eclipse.jetty:jetty-bom:12.0.10"))
api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.9")) api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.10"))
api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3")) api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3"))
api(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.6.0")) api(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.6.0"))
api(platform("org.junit:junit-bom:5.10.2")) api(platform("org.junit:junit-bom:5.10.2"))
@ -130,7 +130,7 @@ dependencies {
api("org.hsqldb:hsqldb:2.7.2") api("org.hsqldb:hsqldb:2.7.2")
api("org.htmlunit:htmlunit:4.1.0") api("org.htmlunit:htmlunit:4.1.0")
api("org.javamoney:moneta:1.4.2") api("org.javamoney:moneta:1.4.2")
api("org.jruby:jruby:9.4.6.0") api("org.jruby:jruby:9.4.7.0")
api("org.junit.support:testng-engine:1.0.5") api("org.junit.support:testng-engine:1.0.5")
api("org.mozilla:rhino:1.7.14") api("org.mozilla:rhino:1.7.14")
api("org.ogce:xpp3:1.1.6") api("org.ogce:xpp3:1.1.6")
@ -139,7 +139,7 @@ dependencies {
api("org.seleniumhq.selenium:htmlunit3-driver:4.20.0") api("org.seleniumhq.selenium:htmlunit3-driver:4.20.0")
api("org.seleniumhq.selenium:selenium-java:4.20.0") api("org.seleniumhq.selenium:selenium-java:4.20.0")
api("org.skyscreamer:jsonassert:1.5.1") api("org.skyscreamer:jsonassert:1.5.1")
api("org.slf4j:slf4j-api:2.0.12") api("org.slf4j:slf4j-api:2.0.13")
api("org.testng:testng:7.9.0") api("org.testng:testng:7.9.0")
api("org.webjars:underscorejs:1.8.3") api("org.webjars:underscorejs:1.8.3")
api("org.webjars:webjars-locator-core:0.55") api("org.webjars:webjars-locator-core:0.55")

View File

@ -42,6 +42,7 @@ import org.springframework.util.StreamUtils;
* Created via the {@link ReactorNettyClientRequestFactory}. * Created via the {@link ReactorNettyClientRequestFactory}.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @author Juergen Hoeller
* @since 6.1 * @since 6.1
*/ */
final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest { final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest {
@ -101,18 +102,8 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest
return result; return result;
} }
} }
catch (RuntimeException ex) { // Exceptions.ReactiveException is package private catch (RuntimeException ex) {
Throwable cause = ex.getCause(); throw convertException(ex);
if (cause instanceof UncheckedIOException uioEx) {
throw uioEx.getCause();
}
else if (cause instanceof IOException ioEx) {
throw ioEx;
}
else {
throw new IOException(ex.getMessage(), cause);
}
} }
} }
@ -136,6 +127,22 @@ final class ReactorNettyClientRequest extends AbstractStreamingClientHttpRequest
} }
} }
static IOException convertException(RuntimeException ex) {
// Exceptions.ReactiveException is package private
Throwable cause = ex.getCause();
if (cause instanceof IOException ioEx) {
return ioEx;
}
if (cause instanceof UncheckedIOException uioEx) {
IOException ioEx = uioEx.getCause();
if (ioEx != null) {
return ioEx;
}
}
return new IOException(ex.getMessage(), cause);
}
private static final class ByteBufMapper implements OutputStreamPublisher.ByteMapper<ByteBuf> { private static final class ByteBufMapper implements OutputStreamPublisher.ByteMapper<ByteBuf> {

View File

@ -33,6 +33,7 @@ import org.springframework.util.StreamUtils;
* {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client. * {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @author Juergen Hoeller
* @since 6.1 * @since 6.1
*/ */
final class ReactorNettyClientResponse implements ClientHttpResponse { final class ReactorNettyClientResponse implements ClientHttpResponse {
@ -79,8 +80,13 @@ final class ReactorNettyClientResponse implements ClientHttpResponse {
return body; return body;
} }
body = this.connection.inbound().receive() try {
.aggregate().asInputStream().block(this.readTimeout); body = this.connection.inbound().receive().aggregate().asInputStream().block(this.readTimeout);
}
catch (RuntimeException ex) {
throw ReactorNettyClientRequest.convertException(ex);
}
if (body == null) { if (body == null) {
throw new IOException("Could not receive body"); throw new IOException("Could not receive body");
} }