2017-10-19 5 views
0

私はパスhttps://github.com/Azure/azure-documentdb-dotnet/tree/master/samples/ChangeFeedMigrationToolのままでフィードプロセッサの変更サンプルを実行しています。私はApp.configファイル内の必要なキー値をCosmos DBを指すように変更しました。Cosmos DB Change FeedプロセッサでRegisterObserverFactoryAsync関数のPartitionKeyをどのように提供しますか?

このサンプルをパーティションコレクションに対して実行すると、オブザーバーファクトリの登録中に例外が発生します。

await host.RegisterObserverFactoryAsync(docObserverFactory); 

例外の詳細:

InvalidOperationException: PartitionKey value must be supplied for this operation. 

    at Microsoft.Azure.Documents.Client.DocumentClient.<AddPartitionKeyInformationAsync>d__34f.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
... 
at ChangeFeedMigrationSample.Program.<RunChangeFeedHostAsync>d__18.MoveNext() in D:\temp\samples\code-samples\ChangeFeedProcessor\Program.cs:line 181 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult() 
    at ChangeFeedMigrationSample.Program.<MainAsync>d__16.MoveNext() in D:\temp\samples\code-samples\ChangeFeedProcessor\Program.cs:line 92 

しかし、関数が任意のパーティション・キーを受け付けません。そして私は1つを渡す方法を知らない。私はこれで何かを欠いていますか?また、私の理解は、Cosmos DB Change Feed Processorライブラリは暗黙的にすべてのパーティションを管理しています。

答えて

1

リース収集は分割されていますか?パーティションリースの収集は現在サポートされていません(まもなく)。エラーメッセージは次のようなものになります。あなたは、単一パーティションのリース収集を試すことができますか?

+0

はい、パーティション分割されていないリース収集で動作します。ありがとうございました。 – vmn

関連する問題