use of io.rsocket.frame.decoder.PayloadDecoder in project spring-framework by spring-projects.
the class RSocketBufferLeakTests method setupOnce.
@BeforeAll
void setupOnce() {
context = new AnnotationConfigApplicationContext(ServerConfig.class);
RSocketMessageHandler messageHandler = context.getBean(RSocketMessageHandler.class);
SocketAcceptor responder = messageHandler.responder();
server = RSocketServer.create(responder).payloadDecoder(PayloadDecoder.ZERO_COPY).interceptors(// intercept responding
registry -> registry.forResponder(payloadInterceptor)).bind(TcpServerTransport.create("localhost", 7000)).block();
requester = RSocketRequester.builder().rsocketConnector(conn -> conn.interceptors(registry -> registry.forRequester(payloadInterceptor))).rsocketStrategies(context.getBean(RSocketStrategies.class)).tcp("localhost", 7000);
}
use of io.rsocket.frame.decoder.PayloadDecoder in project spring-framework by spring-projects.
the class DefaultRSocketRequesterBuilderTests method testPayloadDecoder.
private void testPayloadDecoder(DataBufferFactory bufferFactory, PayloadDecoder payloadDecoder) throws NoSuchFieldException {
RSocketStrategies strategies = RSocketStrategies.builder().dataBufferFactory(bufferFactory).build();
RSocketRequester.builder().rsocketStrategies(strategies).rsocketConnector(this.connectorConfigurer).transport(this.transport);
RSocketConnector connector = this.connectorConfigurer.connector();
assertThat(connector).isNotNull();
Field field = RSocketConnector.class.getDeclaredField("payloadDecoder");
ReflectionUtils.makeAccessible(field);
PayloadDecoder decoder = (PayloadDecoder) ReflectionUtils.getField(field, connector);
assertThat(decoder).isSameAs(payloadDecoder);
}
Aggregations