微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

node.js应用程序中的连接池设置,该应用程序连接到Azure GraphDB并使用gremlin查询

如何解决node.js应用程序中的连接池设置,该应用程序连接到Azure GraphDB并使用gremlin查询

在本教程之后,node.js应用程序连接到Azure cosmos-GraphDB并使用gremlin https://docs.microsoft.com/en-us/azure/cosmos-db/create-graph-nodejs查询GraphDB

创建如下的app.js。一切正常。我可以提交一个gremlin查询并得到结果。我可以使用该gremlin库设置连接池吗?我在 上找不到任何来源,如何设置固定数量的连接池并使用来自池的连接,并在获得结果或经过固定的超时后将连接发送回池延迟。

package.json

“ gremlin”:“ ^ 3.3.4”

app.js

const gremlin = require('gremlin');

const endpoint = 'endpoint';
const port = 'port';
const username = 'username';
const password = 'password';

const url = `wss://${endpoint}:${port}/gremlin`;

const authenticator = new gremlin.driver.auth.PlainTextSaslAuthenticator(
    username,password
  );

graphDBClient = new GremlinClient(url,{
    authenticator,traversalsource: 'g',rejectUnauthorized: true,mimeType: 'application/vnd.gremlin-v2.0+json'
  });

graphDBClient.submit(gremlinQuery);

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。