Skip to content
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

Is it supports the GraphSONMessageSerializerV3d0? #100

Open
tibraga opened this issue Jan 14, 2018 · 1 comment
Open

Is it supports the GraphSONMessageSerializerV3d0? #100

tibraga opened this issue Jan 14, 2018 · 1 comment

Comments

@tibraga
Copy link

tibraga commented Jan 14, 2018

Look my cenarius:

The tinerkpop server conf (serializer)

- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { useMapperFromGraph: graph }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { useMapperFromGraph: graph }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { useMapperFromGraph: graph }}

At log of server, shows below:

[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v2.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0

Before run the code below, In the console tinkerpop, I added one vertex: g.add('test')

When I run this code:

gremlin = require('gremlin');
const client = gremlin.createClient(8182, "localhost", { accept: "application/vnd.gremlin-v2.0+json" });
client.execute('g.V().limit(2)', (err, results) => {
      if (err) {
          return console.error(err)
      }
      console.log(results);
});

It's works. It's shows the log:

[ { '@type': 'g:Vertex',
    '@value': { id: [Object], label: 'test' } } ]

But when changes the option of client (accept) from application/vnd.gremlin-v2.0+json to application/json, happens the below error:

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: Expected Stream, got object
    at /Users/tiago.machado/temp/node_modules/highland/lib/index.js:3504:26
    at /Users/tiago.machado/temp/node_modules/highland/lib/index.js:1576:9
    at Stream.s._send (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:1532:9)
    at Stream.write (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:1633:18)
    at Stream._send (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:959:26)
    at push (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:1498:19)
    at /Users/tiago.machado/temp/node_modules/highland/lib/index.js:2104:13
    at Stream.s._send (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:1532:9)
    at Stream.write (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:1633:18)
    at Stream._send (/Users/tiago.machado/temp/node_modules/highland/lib/index.js:959:26)

Is the client supports the GraphSONMessageSerializerV3d0?

Thanks!

@Tomen
Copy link

Tomen commented Jan 14, 2018

Duplicate of #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants