Azure cosmosdb changefeed for document collection

旧时模样 提交于 2021-02-08 04:59:27

问题


Is it possible to register a service running on a cluster node as observer to changefeed for a document collection across multiple cosmos db accounts in th cluster?

In the case of an Azure Function(triggered by ChangeFeed of a document collection), the function needs to be provisioned for each cosmos db account in the cluster.

https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-processor

https://docs.microsoft.com/en-us/azure/cosmos-db/serverless-computing-database

How can a service API endpoint be triggered by changefeed processor library? Or, how can a service running on a cluster node be registered as an observer to changefeed for a document collection across multiple cosmos db accounts in the cluster?


回答1:


Change Feed Processor Library can be used within any console/worker application and running within any host that is able to have your application running. Samples are available on the GitHub repo https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet#example

The limitation is that one observer can listen to one collection in one account. If you have multiple accounts, each collection (even if they have the same name) is a different collection and requires an individual instance of the Change Feed Processor Library running (collections do not span multiple accounts). This instance could be in the same compute unit as the rest, and it will share the resources (CPU/RAM) or in an independent one.



来源:https://stackoverflow.com/questions/55580277/azure-cosmosdb-changefeed-for-document-collection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!