Class RSocketPayloadReturnValueHandler

java.lang.Object
org.springframework.messaging.handler.invocation.reactive.AbstractEncoderMethodReturnValueHandler
org.springframework.messaging.rsocket.annotation.support.RSocketPayloadReturnValueHandler
All Implemented Interfaces:
HandlerMethodReturnValueHandler

public class RSocketPayloadReturnValueHandler extends AbstractEncoderMethodReturnValueHandler
Extension of AbstractEncoderMethodReturnValueHandler that handles encoded content by wrapping data buffers as RSocket payloads and by passing those through the RESPONSE_HEADER header.
Since:
5.2
Author:
Rossen Stoyanchev
  • Field Details

    • RESPONSE_HEADER

      public static final String RESPONSE_HEADER
      Message header name that is expected to have an AtomicReference which will receive the Flux<Payload> that represents the response.
      See Also:
  • Constructor Details

  • Method Details

    • handleEncodedContent

      protected reactor.core.publisher.Mono<Void> handleEncodedContent(reactor.core.publisher.Flux<DataBuffer> encodedContent, MethodParameter returnType, Message<?> message)
      Description copied from class: AbstractEncoderMethodReturnValueHandler
      Subclasses implement this method to handle encoded values in some way such as creating and sending messages.
      Specified by:
      handleEncodedContent in class AbstractEncoderMethodReturnValueHandler
      Parameters:
      encodedContent - the encoded content; each DataBuffer represents the fully-aggregated, encoded content for one value (i.e. payload) returned from the HandlerMethod.
      returnType - return type of the handler method that produced the data
      message - the input message handled by the handler method
      Returns:
      completion Mono<Void> for the handling
    • handleNoContent

      protected reactor.core.publisher.Mono<Void> handleNoContent(MethodParameter returnType, Message<?> message)
      Description copied from class: AbstractEncoderMethodReturnValueHandler
      Invoked for a null return value, which could mean a void method or method returning an async type parameterized by void.
      Specified by:
      handleNoContent in class AbstractEncoderMethodReturnValueHandler
      Parameters:
      returnType - return type of the handler method that produced the data
      message - the input message handled by the handler method
      Returns:
      completion Mono<Void> for the handling