Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
a0946c89
Commit
a0946c89
authored
Jun 22, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start building against Reactor 2020.0.0 snapshots
See gh-21927
parent
632d9bab
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
23 deletions
+14
-23
NettyWebServerFactoryCustomizer.java
...nfigure/web/embedded/NettyWebServerFactoryCustomizer.java
+2
-2
NettyWebServerFactoryCustomizerTests.java
...re/web/embedded/NettyWebServerFactoryCustomizerTests.java
+2
-8
build.gradle
spring-boot-project/spring-boot-dependencies/build.gradle
+1
-1
ReactorNettyClientCustomizationExample.java
...nction/client/ReactorNettyClientCustomizationExample.java
+3
-4
NettyRSocketServerFactory.java
...amework/boot/rsocket/netty/NettyRSocketServerFactory.java
+2
-2
NettyReactiveWebServerFactory.java
...oot/web/embedded/netty/NettyReactiveWebServerFactory.java
+2
-3
AbstractReactiveWebServerFactoryTests.java
...eactive/server/AbstractReactiveWebServerFactoryTests.java
+2
-3
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizer.java
View file @
a0946c89
...
...
@@ -79,8 +79,8 @@ public class NettyWebServerFactoryCustomizer
}
private
void
customizeConnectionTimeout
(
NettyReactiveWebServerFactory
factory
,
Duration
connectionTimeout
)
{
factory
.
addServerCustomizers
((
httpServer
)
->
httpServer
.
tcpConfiguration
((
tcpServer
)
->
tcpServer
.
selectorOption
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
(
int
)
connectionTimeout
.
toMillis
()
)));
factory
.
addServerCustomizers
((
httpServer
)
->
httpServer
.
option
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
(
int
)
connectionTimeout
.
toMillis
(
)));
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizerTests.java
View file @
a0946c89
...
...
@@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.web.embedded;
import
java.time.Duration
;
import
java.util.Map
;
import
io.netty.bootstrap.ServerBootstrap
;
import
io.netty.channel.ChannelOption
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
...
...
@@ -27,7 +26,6 @@ import org.mockito.ArgumentCaptor;
import
org.mockito.Captor
;
import
org.mockito.MockitoAnnotations
;
import
reactor.netty.http.server.HttpServer
;
import
reactor.netty.tcp.TcpServer
;
import
org.springframework.boot.autoconfigure.web.ServerProperties
;
import
org.springframework.boot.autoconfigure.web.ServerProperties.ForwardHeadersStrategy
;
...
...
@@ -35,7 +33,6 @@ import org.springframework.boot.context.properties.source.ConfigurationPropertyS
import
org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory
;
import
org.springframework.boot.web.embedded.netty.NettyServerCustomizer
;
import
org.springframework.mock.env.MockEnvironment
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
...
...
@@ -110,7 +107,6 @@ class NettyWebServerFactoryCustomizerTests {
verifyConnectionTimeout
(
factory
,
1000
);
}
@SuppressWarnings
(
"unchecked"
)
private
void
verifyConnectionTimeout
(
NettyReactiveWebServerFactory
factory
,
Integer
expected
)
{
if
(
expected
==
null
)
{
verify
(
factory
,
never
()).
addServerCustomizers
(
any
(
NettyServerCustomizer
.
class
));
...
...
@@ -119,10 +115,8 @@ class NettyWebServerFactoryCustomizerTests {
verify
(
factory
,
times
(
1
)).
addServerCustomizers
(
this
.
customizerCaptor
.
capture
());
NettyServerCustomizer
serverCustomizer
=
this
.
customizerCaptor
.
getValue
();
HttpServer
httpServer
=
serverCustomizer
.
apply
(
HttpServer
.
create
());
TcpServer
tcpConfiguration
=
ReflectionTestUtils
.
invokeMethod
(
httpServer
,
"tcpConfiguration"
);
ServerBootstrap
bootstrap
=
tcpConfiguration
.
configure
();
Map
<
Object
,
Object
>
options
=
(
Map
<
Object
,
Object
>)
ReflectionTestUtils
.
getField
(
bootstrap
,
"options"
);
assertThat
(
options
).
containsEntry
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
expected
);
Map
<
ChannelOption
<?>,
?>
options
=
httpServer
.
configuration
().
options
();
assertThat
(
options
.
get
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
)).
isEqualTo
(
expected
);
}
private
void
setupConnectionTimeout
(
Duration
connectionTimeout
)
{
...
...
spring-boot-project/spring-boot-dependencies/build.gradle
View file @
a0946c89
...
...
@@ -1439,7 +1439,7 @@ bom {
]
}
}
library
(
"Reactor Bom"
,
"
Dysprosium-SR7
"
)
{
library
(
"Reactor Bom"
,
"
2020.0.0-SNAPSHOT
"
)
{
group
(
"io.projectreactor"
)
{
imports
=
[
"reactor-bom"
...
...
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/function/client/ReactorNettyClientCustomizationExample.java
View file @
a0946c89
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -19,7 +19,6 @@ package org.springframework.boot.docs.web.reactive.function.client;
import
io.netty.channel.ChannelOption
;
import
io.netty.handler.timeout.ReadTimeoutHandler
;
import
reactor.netty.http.client.HttpClient
;
import
reactor.netty.tcp.TcpClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -39,10 +38,10 @@ public class ReactorNettyClientCustomizationExample {
// tag::custom-http-connector[]
@Bean
ClientHttpConnector
clientHttpConnector
(
ReactorResourceFactory
resourceFactory
)
{
TcpClient
tcpClient
=
Tc
pClient
.
create
(
resourceFactory
.
getConnectionProvider
())
HttpClient
httpClient
=
Htt
pClient
.
create
(
resourceFactory
.
getConnectionProvider
())
.
runOn
(
resourceFactory
.
getLoopResources
()).
option
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
60000
)
.
doOnConnected
((
connection
)
->
connection
.
addHandlerLast
(
new
ReadTimeoutHandler
(
60
)));
return
new
ReactorClientHttpConnector
(
HttpClient
.
from
(
tcpClient
)
);
return
new
ReactorClientHttpConnector
(
httpClient
);
}
// end::custom-http-connector[]
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java
View file @
a0946c89
...
...
@@ -172,8 +172,8 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur
private
ServerTransport
<
CloseableChannel
>
createWebSocketTransport
()
{
if
(
this
.
resourceFactory
!=
null
)
{
HttpServer
httpServer
=
HttpServer
.
create
().
tcpConfiguration
((
tcpServer
)
->
tcpServer
.
runOn
(
this
.
resourceFactory
.
getLoopResources
()).
bindAddress
(
this
::
getListenAddress
)
);
HttpServer
httpServer
=
HttpServer
.
create
().
runOn
(
this
.
resourceFactory
.
getLoopResources
())
.
bindAddress
(
this
::
getListenAddress
);
return
WebsocketServerTransport
.
create
(
httpServer
);
}
return
WebsocketServerTransport
.
create
(
getListenAddress
());
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java
View file @
a0946c89
...
...
@@ -154,11 +154,10 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
if
(
this
.
resourceFactory
!=
null
)
{
LoopResources
resources
=
this
.
resourceFactory
.
getLoopResources
();
Assert
.
notNull
(
resources
,
"No LoopResources: is ReactorResourceFactory not initialized yet?"
);
server
=
server
.
tcpConfiguration
((
tcpServer
)
->
tcpServer
.
runOn
(
resources
).
bindAddress
(
this
::
getListenAddress
));
server
=
server
.
runOn
(
resources
).
bindAddress
(
this
::
getListenAddress
);
}
else
{
server
=
server
.
tcpConfiguration
((
tcpServer
)
->
tcpServer
.
bindAddress
(
this
::
getListenAddress
)
);
server
=
server
.
bindAddress
(
this
::
getListenAddress
);
}
if
(
getSsl
()
!=
null
&&
getSsl
().
isEnabled
())
{
SslServerCustomizer
sslServerCustomizer
=
new
SslServerCustomizer
(
getSsl
(),
getHttp2
(),
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java
View file @
a0946c89
...
...
@@ -456,9 +456,8 @@ public abstract class AbstractReactiveWebServerFactoryTests {
this
.
webServer
.
start
();
HttpClient
client
=
HttpClient
.
create
().
wiretap
(
true
).
compress
(
true
)
.
tcpConfiguration
((
tcpClient
)
->
tcpClient
.
doOnConnected
(
(
connection
)
->
connection
.
channel
().
pipeline
().
addBefore
(
NettyPipeline
.
HttpDecompressor
,
"CompressionTest"
,
new
CompressionDetectionHandler
())));
.
doOnConnected
((
connection
)
->
connection
.
channel
().
pipeline
().
addBefore
(
NettyPipeline
.
HttpDecompressor
,
"CompressionTest"
,
new
CompressionDetectionHandler
()));
return
getWebClient
(
client
,
this
.
webServer
.
getPort
()).
build
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment