简体   繁体   中英

Create Cosmos DocumentDB trigger programmatically and fire event when changed

I have a Cosmos DocumentDB that is being written to by a separate process. I need to know (in my own process) when the content in that DocumentDB changes.

It would be great if it would fire off a local event so I could process the data.

I have been looking in to Microsoft.Azure.Documents.Trigger to do this, but can't seem to wire it up to raise a local event when this happens.

Should I use a different mechanism other than Trigger to accomplish this? Or can I use a Trigger? If so, how?

This is more-or-less a way of doing IPC -- I am trying to avoid polling the DocumentDB for changes.

Thanks for any insight!

After a bunch of research, it turns out I needed to implement change feed support , specifically using the Change Feed Processor library.

If anyone thinks this may be overkill or can come up with a better solution, I am all ears. There just isn't much about this online though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM