-
Notifications
You must be signed in to change notification settings - Fork 100
RSocketResumableTransport with RSocketWebSocketClient and spring backend? #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I believe this issue is a duplicate of #49, as routing and composite metadata frames will be covered there. Also, it's not clear from your description which Spring and RSocket Java versions you are using. If you're using the latest ones, the server should fail while parsing the routing metadata since the client will not be writing it correctly. The routing metadata must be parsed and written in a specific way and the Here's a custom serializer you can use in the meantime: import {
createBuffer,
byteLength
} from 'rsocket-core';
/**
* Serializer for Routing metadata
* @see https://github.com/rsocket/rsocket/blob/master/Extensions/Routing.md
*/
export class RoutingMetadataSerializer {
deserialize(data) {
if (data == null) {
return null;
}
return data.toString('utf8', 1, data.length);
}
serialize(data) {
if (data == null) {
return null;
}
let dataLength = byteLength(data, 'utf8');
let outBuffer = createBuffer(1 + dataLength);
outBuffer.writeUInt8(dataLength, 0);
outBuffer.write(data, 1, data.length, 'utf8');
return outBuffer;
}
}
RoutingMetadataSerializer.MIME_TYPE = "message/x.rsocket.routing.v0";
RoutingMetadataSerializer.MIME_TYPE_ID = 0x7E; |
Sorry if I wasn't clear enough. I am using spring 2.2m4 so the metadata setup I posted works fine for now. It works just fine when I give the RSocketClient an RSocketWebSocketClient for the transport. The problem I am facing is when I give the RSocketClient an RSocketResumableTransport that has been supplied with an RSocketWebSocketClient. The current example rsocketjs provides in packages/examples/ResumeClient is quite different from my use case and I was questioning my config. |
@jeisea rsocket-js needs a new version released - we are hoping to get that done shortly and then it should work with java resumption. |
Hi @jeisea rsocket-js 1.1 has been released. Can you try it and see if it fixes your issue? |
Hi @robertroeser , I tried upgrading to 0.0.11 today and I think the package that was published might have been missing something. After my npm install, my app no longer found the rsocket dependencies and when I checked node_modules, rsocket-core and rsocket-websocket-client only contained package.json. Would be great to know if it's a me issue or an npm issue. |
@stevegury do you need to release other packages as well? |
@robertroeser @jeisea I released a new version (0.0.13), I think this one should be ok. Apologies for the trouble. |
Hello @stevegury . Issue with release still exists. There is a mention here also: |
@maxim-bandurko-lsvt sorry for the trouble, could you try again with 0.0.16? |
@stevegury It worked well, thank you! |
Please use 0.0.16, v0.1.0-alpha is an experimental version based on 0.0.13 codebase. |
@stevegury I see. ok, thank you! |
@robertroeser I've tried 'message/x.rsocket.routing.v0' with latest release and it works perfect! Thank you! |
Thanks! |
Hi, I tried following the example for the ResumableTransport, but subscribing to the connection never hits onComplete. The main difference is that I'm using the RSocketWebSocketClient and a spring backend which means my setup for the client looks like this
No errors in server logs or browser console logs.
Thanks!
EDIT: Was poking around rsocket-java issues and found rsocket/rsocket-java#602 which seems to be referring to the same issue. Feel free to close if you feel my post is redundant.
The text was updated successfully, but these errors were encountered: