4

I have a Spring Boot Java server with an embedded in memory JanusGraph instance. While my server is running, I would like to connect to that embedded in memory JanusGraph instance via the Gremlin console for verification purposes.

Here is how I am standing up my embedded in memory JanusGraph instance:

@Bean
public JanusGraph janusGraph() {
  JanusGraphFactory.Builder builder = JanusGraphFactory.build()
    .set("storage.backend", "inmemory")
  return builder.open();
}

I have set up a connection to an in memory gremlin-server before from my application and I can connect to that via the gremlin console, but I would prefer to have JanusGraph be embedded in my application.

I would like something like this:

:remote connect tinkerpop.server conf/remote.yaml session-managed

but for an embedded inmemory Janusgraph instance.

I am really wondering if there is any way to connect to an embedded janusgraph instance via the gremlin console. Thanks!

1 Answers1

2

This is not possible. Connecting to a remote JanusGraph instance via the gremlin console requires Gremlin Server or other Remote Gremlin Provider. Since you have embedded the JanusGraph instance in your own application without exposing a Tinkerpop compliant gremlin server/remote gremlin provider there is no way to connect remotely. The docs located at:

https://docs.janusgraph.org/basics/deployment/#embedded-janusgraph

don't directly state this fact, but it seems to be implied.

Also check out the tinkerpop docs at:

http://tinkerpop.apache.org/docs/current/reference/#connecting-gremlin

for more details about connecting to graphs.

Greg Valainis
  • 190
  • 1
  • 8
  • Ok thanks for the response. Do you know if it is possible to expose that capability from inside a custom application? the ':remote connect' command takes a plugin (usually tinkerpop.server). My thought is that it may be possible by developing my own plugin that exposes some ability from my own application to server that gremlin console connection, but this idea is half baked. Would you have any knowledge about this? Thanks! – Cody Martin Nov 19 '19 at 19:36
  • 1
    Possible? Yes. Easy to do? I am not sure. Tinkerpop and Janus graph are open source so you can see how they do it in their respective code repositories. The janusgraph implementation seems to be a thin wrapper around the gremlin-server from apache so perusing their code might give you some insights into a quick way to get started. – Greg Valainis Nov 19 '19 at 20:21
  • @CodyMartin, any luck in this regard? were you able to connect via gremlin console? – Ankush Mar 25 '21 at 13:38