diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandler.java index 88d24a6b7d..8fb6cd400a 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/reactive/MessageMappingMessageHandler.java @@ -201,7 +201,7 @@ public class MessageMappingMessageHandler extends AbstractMethodMessageHandlerIf {@link #setRSocketStrategies(RSocketStrategies) rsocketStrategies} + * is also set, this property is re-initialized with the decoders in it. + * Or vice versa, if {@link #setRSocketStrategies(RSocketStrategies) + * rsocketStrategies} is not set, it will be initialized from this and + * other properties. + */ + @Override + public void setDecoders(List> decoders) { + super.setDecoders(decoders); + } + /** * Configure the encoders to use for encoding handler method return values. + *

If {@link #setRSocketStrategies(RSocketStrategies) rsocketStrategies} + * is also set, this property is re-initialized with the encoders in it. + * Or vice versa, if {@link #setRSocketStrategies(RSocketStrategies) + * rsocketStrategies} is not set, it will be initialized from this and + * other properties. */ public void setEncoders(List> encoders) { this.encoders.addAll(encoders); @@ -84,12 +103,12 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler { } /** - * Provide configuration in the form of {@link RSocketStrategies}. This is - * an alternative to using {@link #setEncoders(List)}, - * {@link #setDecoders(List)}, and others directly. It is convenient when - * you also configuring an {@link RSocketRequester} in which case the - * {@link RSocketStrategies} encapsulates required configuration for re-use. - * @param rsocketStrategies the strategies to use + * Provide configuration in the form of {@link RSocketStrategies} instance + * which can also be re-used to initialize a client-side + * {@link RSocketRequester}. When this property is set, it also sets + * {@link #setDecoders(List) decoders}, {@link #setEncoders(List) encoders}, + * and {@link #setReactiveAdapterRegistry(ReactiveAdapterRegistry) + * reactiveAdapterRegistry}. */ public void setRSocketStrategies(@Nullable RSocketStrategies rsocketStrategies) { this.rsocketStrategies = rsocketStrategies; @@ -100,6 +119,10 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler { } } + /** + * Return the configured {@link RSocketStrategies}. This may be {@code null} + * before {@link #afterPropertiesSet()} is called. + */ @Nullable public RSocketStrategies getRSocketStrategies() { return this.rsocketStrategies;