List of usage examples for org.springframework.messaging.handler.invocation.reactive HandlerMethodReturnValueHandler DATA_BUFFER_FACTORY_HEADER
String DATA_BUFFER_FACTORY_HEADER
To view the source code for org.springframework.messaging.handler.invocation.reactive HandlerMethodReturnValueHandler DATA_BUFFER_FACTORY_HEADER.
Click Source Link
From source file:org.springframework.messaging.handler.invocation.reactive.AbstractEncoderMethodReturnValueHandler.java
@Override public Mono<Void> handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, Message<?> message) {/* w ww. ja v a 2 s . c o m*/ if (returnValue == null) { return handleNoContent(returnType, message); } DataBufferFactory bufferFactory = (DataBufferFactory) message.getHeaders().getOrDefault( HandlerMethodReturnValueHandler.DATA_BUFFER_FACTORY_HEADER, this.defaultBufferFactory); MimeType mimeType = (MimeType) message.getHeaders().get(MessageHeaders.CONTENT_TYPE); Flux<DataBuffer> encodedContent = encodeContent(returnValue, returnType, bufferFactory, mimeType, Collections.emptyMap()); return new ChannelSendOperator<>(encodedContent, publisher -> handleEncodedContent(Flux.from(publisher), returnType, message)); }