-
Notifications
You must be signed in to change notification settings - Fork 63
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
Custom serializer issue #29
Comments
Ok I think I'm starting to understand. This might be more of an overhaul than expected. Are you by any chance using a
Fixing/adding this would imply:
ouch |
The above should indeed make gremlin-javascript send the appropriate Are you getting any specific error? If I get your point right, you will most likely run into issues if you use For now, I think your best bet would be to use the lower level Gremlin.createClient(8182, "localhost", {
accept: "application/gremlinbin",
executeHandler: function(stream, callback) {
// Handle stream yourself and fire the callback when done.
}
}) That handler is simply a function with a |
Woops, I didn't see your next message. Let me re-read that carefully. |
Thanks for all the info on Thanks for looking into this though. Appreciate the time you're putting up |
I'm adding more info as I go. Hopefully this cuts down on research time and bugs and stuff: Found the following pertaining to binary data from
Note that for binary at least gremlin-server requires that you send masked packets :
In terms of the message to be sent a breakdown from the gremlin-server docs would be that your binary message needs to be As far as the server response goes, If memory serves me well you will get the same thing you get now. A |
So I've looked into a couple more things. I think binary info should be packed using The response from the server actually uses a So I guess it's not all that bad, changing |
Can you tell me what |
Thanks for working on a PR, I appreciate it. I remember discussing this with @spmallette a while ago. |
woops I deleted my previous comment. But thanks that answers my question |
Sure. I did so because the client can theoretically be used both in Node.js and in browsers that supports WebSocket. If I recall correctly, there is a discrepancy between the WebSocket API provided by the |
We may have to create a |
Ok thanks for the info. I'm currently using it in browser (via browserify) and The idea behind the custom serializer was to allow console like output (while retaining all graphson data) for http://www.gremlinbin.com/bin/view/56e70e4457f36 Regarding the implementation of this change I'm still trying to figure out what the best course of action is. In theory with the switch to binary there is no more need for the old The only thing that this changes is how messages are packed and unpacked and currently both of these are done in I don't know if that change is warranted in this PR though. |
I agree that the packing/unpacking of messages shouldn't be done at the |
… sends the correct mimeType to the server
Hey, I'm using webpack to pack 852574f?diff=split and it doesn't work unfortunately. It chokes on : const rawMessage = JSON.parse(data.toString());
^ The browser doesn't get the |
Do you have any ideas what the other options may be? Maybe another dependency (though I don't really like the sound of that)? I'd love to get this fixed sometime this weekend. (I might give this another crack) |
I don't think there's an easy way out when using Wepack or browserify. It looks like the Node.js When in browser, we may have some luck playing around with the Interesting reads on the topic:
|
Ok I'm going to look at those. |
ah wait indeed the |
Ok I think I got this to work with minor changes. I'm going to make a PR against https://github.com/jbmusso/gremlin-javascript/tree/PommeVerte-switch-to-binary so you can test the node end implications |
Got the PR in #34 . Let me know how that goes |
Hey JB,
I'm trying to implement
gremlin-javascript
with a custom server side serializer. For the client this should be pretty transparent as the response message structure doesn't change (only the data being sent back). It however requires that the request message sent from the client have a different mimetype (application/gremlinbin
). The following does not seem to work:It's pretty easy to test manually as gremlin-server will complain about having to use
GraphSONMessageSerializerV1d0
by default because it can't find the serializer associated with that mimetype.Any hint as to what would need to be fixed for this? I'm a little lost running through your code but with some guidance I could probably pull a fix.
The text was updated successfully, but these errors were encountered: