Is it true that you cannot set ChangeFeedOptions (specifically PartitionKey and lease-prefix) when using the high-level ChangeFeedProcessor? Is that library too high level? I'm using V3 Cosmos. All the examples on the web show low-level V2 ways to set this up. Here's V3 ProcessorBuilder... I need a .options or .WithPartitionKey, etc.
ChangeFeedProcessor changeFeedProcessor = cosmosClient.GetContainer("myDB", "myContainer")
.GetChangeFeedProcessorBuilder<myData>("changeFeedTest", HandleChangesAsync)
.WithPollInterval(new TimeSpan(0, 0, 1))
.WithInstanceName("Host1" )
.WithLeaseContainer(leaseContainer)
.Build();
Maybe a concrete example will help:
Let's say you have a chess game. Players' moves are sent to CosmosDB in a PlayerActions Container. All players and spectators of that game subscribe to the change feed. Works fine, but at scale? When you have 10,000 games running, you don't want every client to get 10,000 times more notifications than they should. Just the ones from the GameID (PartitionKey) they're interested in. I'm almost certain no one is going to advise me to have 1 container per game, so I need to filter the change feed. I'd rather use the V3 processor library, but I may need to go with a lower level API. Anyone have any tips before I do the extra work?
Here's another way to ask the question. In the example in the docs here: https://learn.microsoft.com/en-us/azure/cosmos-db/change-feed-processor They show cities A-E going to one host processor, but there doesn't seem to be an API any more to that set up with GetChangeFeedProcessorBuilder.