This appears to be a bug in Apache TinkerPop. I opened an issue to track this.
One workaround is to configure your remote driver configuration to use the GraphSON serializer instead of Gryo. This does not require any changes to the server config. For example, in conf/remote-objects.yaml
:
hosts: [localhost]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0,
config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] } }
A different workaround is to define another traversal source in a Gremlin Server script. For example, if you are using the default conf/gremlin-server/gremlin-server.yaml
, update the global bindings in scripts/empty-sample.groovy
:
// define the default TraversalSource to bind queries to - named "g".
// define a subgraph traversal source - named "sg"
globals << [g : graph.traversal(),
sg: graph.traversal().withStrategies(SubgraphStrategy.build().edges(
__.has("field", "condition")).create())]
Then you can utilize that traversal source from your remote driver:
cluster = Cluster.open('conf/remote-objects.yaml')
graph = EmptyGraph.instance()
sg = graph.traversal().withRemote(DriverRemoteConnection.using(cluster, "sg"))