2.1.4.0
起(相关 GitHub 问题),模拟器现已支持 gremlin。/EnableGremlinEndpoint
开关。gremlin console
连接我的Azure Cosmos DB
,这很顺利。hosts: [jaygong.graphs.azure.com]
port: 443
username: /dbs/testdb/colls/jay
password: ****************
connectionPool: {enableSsl: true}
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { serializeResultToString: true }}
然后,我按照你的配置尝试连接 Azure Cosmos DB Emulator
。
hosts: [localhost]
port: 8081
username: /dbs/familyDB/colls/FamilyCollection
password: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
connectionPool: {
enableSsl: true}
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { serializeResultToString: true }}
经过多次尝试,我也遇到了与您相同的问题。
最后,我找到了这个反馈链接,看起来Cosmos DB Emulator
目前不支持Gremlin API。
考虑成本,我建议您在开发阶段使用Apache TinkerPop服务器
代替Azure Cosmos DB Emulator
在本地测试您的代码。测试完成后,切换到Azure Cosmos DB。
此外,Azure Cosmos DB Emulator
支持提到的Graph API
这里。
通过使用Azure Cosmos DB模拟器,您可以使用图形API进行本地开发和测试,而无需创建Azure订阅或产生任何费用。当您对模拟器中应用程序的工作方式感到满意时,可以切换到云中使用Azure Cosmos DB帐户。
这段文字可以在这里找到。然而,在我对源代码的研究后,这里提到的模拟器支持的Graph API仅适用于.Net
,不适用于java或node.js。
因此,看起来Azure Cosmos DB模拟器存在缺陷,因为它可能没有跟上Azure Cosmos DB服务最近的变化。
希望对您有所帮助。