|
40 | 40 | import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
41 | 41 |
|
42 | 42 | import io.netty.buffer.PooledByteBufAllocator;
|
43 |
| -import io.netty.util.NetUtil; |
44 | 43 | import io.rsocket.frame.decoder.PayloadDecoder;
|
45 |
| -import io.rsocket.transport.netty.client.TcpClientTransport; |
46 | 44 | import reactor.core.publisher.Flux;
|
47 | 45 | import reactor.core.publisher.Mono;
|
48 |
| -import reactor.netty.tcp.InetSocketAddressUtil; |
49 |
| -import reactor.netty.tcp.TcpClient; |
50 | 46 |
|
51 | 47 | /**
|
52 | 48 | * @author Artem Bilan
|
@@ -87,18 +83,10 @@ public ServerRSocketConnector serverRSocketConnector() {
|
87 | 83 | return serverRSocketConnector;
|
88 | 84 | }
|
89 | 85 |
|
90 |
| - |
91 | 86 | @Bean
|
92 | 87 | public ClientRSocketConnector clientRSocketConnector(ServerRSocketConnector serverRSocketConnector) {
|
93 |
| - ClientRSocketConnector clientRSocketConnector = |
94 |
| - new ClientRSocketConnector( |
95 |
| - TcpClientTransport.create( |
96 |
| - TcpClient.create() |
97 |
| - .addressSupplier(() -> |
98 |
| - InetSocketAddressUtil.createUnresolved( |
99 |
| - NetUtil.LOCALHOST.getHostAddress(), |
100 |
| - serverRSocketConnector.getBoundPort().block())) |
101 |
| - )); |
| 88 | + int port = serverRSocketConnector.getBoundPort().block(); |
| 89 | + ClientRSocketConnector clientRSocketConnector = new ClientRSocketConnector("localhost", port); |
102 | 90 | clientRSocketConnector.setFactoryConfigurer((factory) -> factory.frameDecoder(PayloadDecoder.ZERO_COPY));
|
103 | 91 | clientRSocketConnector.setRSocketStrategies(rsocketStrategies());
|
104 | 92 | clientRSocketConnector.setAutoStartup(false);
|
|
0 commit comments