title: RSocket Net client request stream routing metadata to spring boot @MessageMapping routes
body: <p>Similar to <a href="https://stackoverflow.com/questions/62742430/rsocket-routing-metadata-using-rsocket-java-for-spring-rsocket-server">rsocket routing metadata using RSocket-Java for Spring Rsocket Server</a> 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:</p>
  <pre><code>@MessageMapping(value = &quot;helloWorld&quot;)
  public Flux&lt;String&gt; getFluxSocket() {
      log.traceEntry();
      log.info(&quot;In hello world&quot;);
      
      return Flux.just(&quot;{\&quot;Hello\&quot;:\&quot;World\&quot;}&quot;);
  }
  </code></pre>
  <p>When spring boot server is running locally, to get this flux you can use <a href="https://github.com/making/rsc/releases" rel="nofollow noreferrer">rsc client</a></p>
  <p><code>java -jar rsc.jar --debug --request --route helloWorld ws://localhost:7000</code></p>
  <p>Or for a stream</p>
  <p><code>java -jar rsc.jar --debug --stream --route myStream ws://localhost:7000</code></p>
  <p>To do this programmatically in C# Net it says <a href="https://github.com/rsocket/rsocket-net/issues/19" rel="nofollow noreferrer">here</a> that request routing is not yet supported in RSocket Net but can use metadata payload. Has anyone got the Net equivalent of this?</p>
  <pre><code>CompositeByteBuf metadata = ByteBufAllocator.DEFAULT.compositeBuffer();
  RoutingMetadata routingMetadata = TaggingMetadataCodec.createRoutingMetadata(ByteBufAllocator.DEFAULT, List.of(&quot;/route&quot;));
  CompositeMetadataCodec.encodeAndAddMetadata(metadata,
          ByteBufAllocator.DEFAULT,
          WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,
          routingMetadata.getContent());
  </code></pre>
  <p>Thanks</p>