On websocket connection between .net and spring boot rsocket I am trying to encode the routing header to the quotes
endpoint like this:
int routeSize = 6;
string hexValue = routeSize.ToString("X");
metaData = hexValue + "quotes";
I don't think this is correct. The entire net client code is
var client = new RSocketClient(new WebSocketTransport("ws://127.0.0.1:7000/"));
await client.ConnectAsync(new RSocketOptions()
{
InitialRequestSize = 3,
DataMimeType = "application/json",
MetadataMimeType = "message/x.rsocket.routing.v0"
});
String json = {\"myQuote\":\"1234\"}
int routeSize = 6;
string hexValue = routeSize.ToString("X");
metaData = hexValue + "quotes";
var stringclient = new RSocketClient.ForStrings(client);
await stringclient.RequestStream(json, metaData)
.ForEachAsync((result) =>
{
Console.WriteLine($"Result ===> {result}");
});
and this produces the error
0001 Error {000}: [00000201] readerIndex(1) + length(54) exceeds writerIndex(7): UnpooledSlicedByteBuf(ridx: 1, widx: 7, cap: 7/7, unwrapped: PooledUnsafeDirectByteBuf(ridx: 0, widx: 281, cap: 281))
As related to RSocket Net client request stream routing metadata to spring boot @MessageMapping routes what's required is the C# equivalent of JavaScript String.fromCharCode(route.length) + route;