Azure Cosmos Graph DB:获取 WebSocket 异常

问题描述

我使用 .Net Gremlin SDK(Gremlin.Net 3.4.8) 连接到 Cosmos DB。我在 Gremlin.Net.Driver.WebSocketConnection 处收到 System.Net.sockets.socketException。

异常信息:连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接建立失败,因为连接的主机没有响应 这是我连接到 Cosmos DB 的方式:

            ConnectionPoolSettings connectionPoolSettings = new ConnectionPoolSettings
            {
                PoolSize = 50,MaxInProcessperConnection = 32,};
            
            GremlinServer gremlinServer = new GremlinServer(
                            AzureGraphEndpoint,AzureGraPHPort,enableSsl: true,username: "/dbs/" + AzureGraphDatabaseName + "/colls/" + AzureGraphDBContainerName,password: AzureGraPHPrimaryKey);
            this.gremlinClient = new GremlinClient(
                            gremlinServer,new GraphSON2Reader(),new GraphSON2Writer(),GremlinClient.GraphSON2MimeType,connectionPoolSettings: connectionPoolSettings);

当观察到此行为时,到 DB 的流量为 1000 请求/秒。 任何人都知道为什么会发生这种情况。我应该尝试更新我的 ConnectionPoolSettings 还是在创建 GremlinClient 时尝试传递 Web 套接字配置。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)