如何通过Gremlin Console连接到嵌入式内存Janusgraph

问题描述 投票:0回答:1

我有一个Spring Boot Java服务器,该服务器具有嵌入在内存中的JanusGraph实例。当我的服务器运行时,我想通过Gremlin控制台连接到嵌入在内存JanusGraph实例中的那个,以进行验证。

这是我如何站立在内存JanusGraph实例中的嵌入式方法:

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

我之前从我的应用程序建立了到内存gremlin服务器的连接,我可以通过gremlin控制台连接到该服务器,但是我更希望将JanusGraph嵌入到我的应用程序中。

我想要这样的东西:

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

但对于embedded内存Janusgraph实例。

我真的很想知道是否有任何方法可以通过gremlin控制台连接到嵌入式janusgraph实例。谢谢!

gremlin tinkerpop3 janusgraph
1个回答
0
投票

这是不可能的。通过gremlin控制台连接到远程JanusGraph实例需要Gremlin Server或其他Remote Gremlin Provider。由于您将JanusGraph实例嵌入自己的应用程序中而没有暴露与Tinkerpop兼容的gremlin服务器/远程gremlin提供程序,因此无法进行远程连接。该文档位于:

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

没有直接说明这个事实,但这似乎是隐含的。

也可以在以下位置查看tinkerpop文档:

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

有关连接图形的更多详细信息。

© www.soinside.com 2019 - 2024. All rights reserved.