With bare RSocket, you can return payload metadata from a SocketAcceptor, and an RSocket client can receive that payload with metadata. Using Spring @Controller-annotated classes with @MessageMapping-annotated methods, you can't return any metadata/headers, the only supported direction for headers is in. RSocketRequester also has no way to receive them.

Comment From: rstoyanchev

RSocketRequester allows sending metadata with a request, and @MessageMapping methods can access that as @Header arguments if there is a registered MetadataExtractor.

To enable the same for responses, we would need some container of metadata+payload that a controller method can return, most likely Message, which is what we use for request metadata. So a controller method returns a Message with headers and payload, and an application supplied MetadataInserter to help encode metadata entries from a map of headers. The requester would then decode to a Mono or Flux of Message<T>, and we could use the same registered MetadataExtractor to extract headers.

It would be useful to understand more about the need for this. For example if it relates to #26379, then better to focus on that before it's clear that this is also needed.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.