The RSocketRequester does not currently support the metadata push interaction model of RSocket directly. Instead, you have to get the underlying RSocket and then build out your own composite metadata as follows:

CompositeByteBuf metadataByteBuf = ByteBufAllocator.DEFAULT.compositeBuffer();
CompositeMetadataFlyweight.encodeAndAddMetadata(
    metadataByteBuf,
    ByteBufAllocator.DEFAULT,
    "messaging/x.hello.messageformat",
    ByteBufAllocator.DEFAULT.buffer().writeBytes(messageFormat.getBytes()));

rSocketRequester.rsocket()
    .metadataPush(ByteBufPayload.create(Unpooled.EMPTY_BUFFER, metadataByteBuf))
    .block();

Full example here: https://github.com/gregwhitaker/springboot-rsocketmetadatapush-example

This is a little difficult on users of the library. I would like to suggest an enhancement that adds support for the metadata push interaction model to RSocketRequester.

Not sure what to suggest at this point as there are already request-level "metadata" methods on there that may cause confusion if a new metapush method was added. @rstoyanchev (if i understood his comment correctly) suggested sending a metadata push frame if no data was supplied and only metadata. On the surface that seems ok to me as I can't dream up any scenarios where I would be doing "metadata push" at the request level that I couldn't just use a combination of request metadata and the data payload for at that point, but I may be totally missing something obvious. Thoughts?

Comment From: rstoyanchev

Indeed I did mean enhancing the send() method to do either fire-and-forget or metadata push depending on what was provided, data (and metadata) or just metadata.

The other alternative is to add sendMetadata() but seems like send() should suffice. Essentially send whatever has been provided where metadata-only means a metadata push.

Comment From: rstoyanchev

I ended up with a dedicated sendMetadata() method to avoid any ambiguity, and that's only available before any of the data methods are used.