Similar to rsocket routing metadata using RSocket-Java for Spring Rsocket Server but for an RSocket Net Client, we use a spring boot @MessageMapping for websocket endpoint routes on port 7000 which return webfluxes depending on the route. For example:
@MessageMapping(value = "helloWorld")
public Flux<String> getFluxSocket() {
log.traceEntry();
log.info("In hello world");
return Flux.just("{\"Hello\":\"World\"}");
}
When spring boot server is running locally, to get this flux you can use rsc client
java -jar rsc.jar --debug --request --route helloWorld ws://localhost:7000
Or for a stream
java -jar rsc.jar --debug --stream --route myStream ws://localhost:7000
To do this programmatically in C# Net it says here that request routing is not yet supported in RSocket Net but can use metadata payload. Has anyone got the Net equivalent of this?
CompositeByteBuf metadata = ByteBufAllocator.DEFAULT.compositeBuffer();
RoutingMetadata routingMetadata = TaggingMetadataCodec.createRoutingMetadata(ByteBufAllocator.DEFAULT, List.of("/route"));
CompositeMetadataCodec.encodeAndAddMetadata(metadata,
ByteBufAllocator.DEFAULT,
WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,
routingMetadata.getContent());
Thanks