Simplify RSocket client responder config
Now that responder RSocketStrategies also exposes responder strategies, AnnotationClientResponderConfigurer is reduced and no longer needs to be public. This commit folds it into RSocketMessageHandler as a nested class and exposes it as a ClientRSocketFactoryConfigurer through a static method that accepts the handlers to use. Effectively a shortcut for creating RSocketMessageHandler, giving it RSocketStrategies, calling afterPropertiesSet, and then the instance createResponder. See gh-23314
This commit is contained in:
@@ -39,7 +39,6 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||
import org.springframework.messaging.rsocket.annotation.ConnectMapping;
|
||||
import org.springframework.messaging.rsocket.annotation.support.AnnotationClientResponderConfigurer;
|
||||
import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
@@ -111,7 +110,7 @@ public class RSocketServerToClientIntegrationTests {
|
||||
factory.metadataMimeType("text/plain");
|
||||
factory.setupPayload(ByteBufPayload.create("", connectionRoute));
|
||||
})
|
||||
.rsocketFactory(AnnotationClientResponderConfigurer.withHandlers(new ClientHandler()))
|
||||
.rsocketFactory(RSocketMessageHandler.clientResponder(new ClientHandler()))
|
||||
.rsocketStrategies(context.getBean(RSocketStrategies.class))
|
||||
.connectTcp("localhost", server.address().getPort())
|
||||
.block();
|
||||
|
||||
Reference in New Issue
Block a user