- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试适用于 Azure-Cosmos 的 ChangeFeedProcessor SDK 示例应用程序。
仓库的 GIT 链接: https://github.com/Azure/azure-documentdb-changefeedprocessor-java
已配置所有必需的属性,如下所示
COSMOSDB_ENDPOINT={主机和端口}
COSMOSDB_SECRET={secretKey}
COSMOSDB_DATABASE={DBName}
COSMOSDB_COLLECTION={集合名称}
COSMOSDB_AUX_COLLECTION={AuxCollectionName}
COSMOSDB_LEASE_COLLECTION={LeaseCollectionName}
并在sample.java中提供主机名
在DocumentLeaseServiceManager.initialize()方法中,documentServices.createDocument() 操作成功,而 documentServices.deleteDocument() 失败并出现以下错误
java.lang.UnsupportedOperationException: PartitionKey value must be supplied for this operation. at com.microsoft.azure.documentdb.DocumentClient.addPartitionKeyInformation(DocumentClient.java:3346) at com.microsoft.azure.documentdb.DocumentClient.deleteDocument(DocumentClient.java:1047) at com.microsoft.azure.documentdb.changefeedprocessor.services.DocumentServices.deleteDocument(DocumentServices.java:248) at com.microsoft.azure.documentdb.changefeedprocessor.internal.documentleasestore.DocumentServiceLeaseManager.initialize(DocumentServiceLeaseManager.java:116) at com.microsoft.azure.documentdb.changefeedprocessor.ChangeFeedEventHost.initializeIntegrations(ChangeFeedEventHost.java:165) at com.microsoft.azure.documentdb.changefeedprocessor.ChangeFeedEventHost.start(ChangeFeedEventHost.java:143) at com.microsoft.azure.documentdb.changefeedprocessor.ChangeFeedEventHost.lambda$registerObserverFactory$0(ChangeFeedEventHost.java:133) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
非常感谢解决方案。
最佳答案
该版本的更改源处理器似乎相当旧。可能与分区的租赁容器不兼容。如果您的 Lease 集合已分区(分区键应为 /id
),请尝试更新的 Change Feed Processor,该处理器已成为 Java SDK 的一部分。
关于java - azure 宇宙 : changeFeedProcessor: Error: PartitionKey value must be supplied for this operation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58870515/
我正在尝试运行 ChangeFeedProcessor 的 2 个实例,它们都指向相同的集合,并在 Cosmos 帐户中使用相同的租赁集合。我在两个实例中都指定了唯一的hostName 我的目的是根据
我正在尝试适用于 Azure-Cosmos 的 ChangeFeedProcessor SDK 示例应用程序。 仓库的 GIT 链接: https://github.com/Azure/azure-d
我是一名优秀的程序员,十分优秀!