use of org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler in project spring-security by spring-projects.
the class RSocketSecurity method build.
public PayloadSocketAcceptorInterceptor build() {
PayloadSocketAcceptorInterceptor interceptor = new PayloadSocketAcceptorInterceptor(payloadInterceptors());
RSocketMessageHandler handler = getBean(RSocketMessageHandler.class);
interceptor.setDefaultDataMimeType(handler.getDefaultDataMimeType());
interceptor.setDefaultMetadataMimeType(handler.getDefaultMetadataMimeType());
return interceptor;
}
use of org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler in project spring-boot by spring-projects.
the class RSocketMessagingAutoConfiguration method messageHandler.
@Bean
@ConditionalOnMissingBean
public RSocketMessageHandler messageHandler(RSocketStrategies rSocketStrategies, ObjectProvider<RSocketMessageHandlerCustomizer> customizers) {
RSocketMessageHandler messageHandler = new RSocketMessageHandler();
messageHandler.setRSocketStrategies(rSocketStrategies);
customizers.orderedStream().forEach((customizer) -> customizer.customize(messageHandler));
return messageHandler;
}
use of org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler in project spring-boot by spring-projects.
the class RSocketMessagingAutoConfigurationTests method shouldApplyMessageHandlerCustomizers.
@Test
void shouldApplyMessageHandlerCustomizers() {
this.contextRunner.withUserConfiguration(CustomizerConfiguration.class).run((context) -> {
RSocketMessageHandler handler = context.getBean(RSocketMessageHandler.class);
assertThat(handler.getDefaultDataMimeType()).isEqualTo(MimeType.valueOf("application/json"));
});
}
use of org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler 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 org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler in project spring-framework by spring-projects.
the class RSocketServerToClientIntegrationTests method setupOnce.
@BeforeAll
@SuppressWarnings("ConstantConditions")
static void setupOnce() {
context = new AnnotationConfigApplicationContext(RSocketConfig.class);
RSocketMessageHandler messageHandler = context.getBean(RSocketMessageHandler.class);
SocketAcceptor responder = messageHandler.responder();
server = RSocketServer.create(responder).payloadDecoder(PayloadDecoder.ZERO_COPY).bind(TcpServerTransport.create("localhost", 0)).block();
}
Aggregations