File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
spring-web/src/main/java/org/springframework/http/client/reactive Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 22
22
import org .springframework .http .HttpMethod ;
23
23
24
24
import reactor .core .publisher .Mono ;
25
+ import reactor .ipc .netty .config .ClientOptions ;
25
26
import reactor .ipc .netty .http .HttpException ;
26
27
import reactor .ipc .netty .http .HttpInbound ;
27
28
34
35
*/
35
36
public class ReactorClientHttpConnector implements ClientHttpConnector {
36
37
38
+ private final ClientOptions clientOptions ;
39
+
40
+ /**
41
+ * Create a Reactor Netty {@link ClientHttpConnector} with default {@link ClientOptions}
42
+ * and SSL support enabled.
43
+ */
44
+ public ReactorClientHttpConnector () {
45
+ this (ClientOptions .create ().sslSupport ());
46
+ }
47
+
48
+ /**
49
+ * Create a Reactor Netty {@link ClientHttpConnector} with the given {@link ClientOptions}
50
+ */
51
+ public ReactorClientHttpConnector (ClientOptions clientOptions ) {
52
+ this .clientOptions = clientOptions ;
53
+ }
54
+
37
55
@ Override
38
56
public Mono <ClientHttpResponse > connect (HttpMethod method , URI uri ,
39
57
Function <? super ClientHttpRequest , Mono <Void >> requestCallback ) {
40
58
41
- return reactor .ipc .netty .http .HttpClient .create (uri . toString () )
59
+ return reactor .ipc .netty .http .HttpClient .create (this . clientOptions )
42
60
.request (io .netty .handler .codec .http .HttpMethod .valueOf (method .name ()),
43
61
uri .toString (),
44
62
httpClientRequest -> requestCallback
You can’t perform that action at this time.
0 commit comments