Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate Headers.Session on FeedResponse from GetChangeFeedIterator (pull model) #4267

Open
TravisTroyer opened this issue Jan 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working ChangeFeed customer-reported Issue created by a customer needs-investigation

Comments

@TravisTroyer
Copy link

Is your feature request related to a problem? Please describe.
I have a change feed consumer that reacts to certain changes by putting a message on a service bus queue to be handled by another process downstream. I don't include the actual document in the service bus queue because the downstream process may not need it, or may need other documents in the same partition to complete its task. That process is designed to work independently, knowing just the partition ID it's working with.

The problem is that we're using session consistency and sometimes the change consumer becomes aware of a new document, but the downstream process doesn't get that document when it reads all the documents out of the partition.

Describe the solution you'd like
FeedResponse.Headers.Session exists, but is always null when using GetChangeFeedIterator. I'd like it to not be null.

Describe alternatives you've considered
I've considered putting the document in my service bus message, but that comes with some weirdness, as described above. I've also considered retrying downstream if the latest document observed by the change feed consumer isn't in my query results if and when the downstream process attempts to do its work. The latter is what I'm doing now, but having access to the Session token header would really provide a better solution.

Additional context
Passing around and using the the session token when making requests is described as a suggested pattern in the CosmosDb documentation, but isn't possible in this scenario because the SDK isn't returning the Session token:

https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-manage-consistency?tabs=portal%2Cdotnetv2%2Capi-async#utilize-session-tokens

Also worth noting, the Session header is available when using the change feed processor, instead of the pull model.

@ealsur
Copy link
Member

ealsur commented Jan 19, 2024

Duplicate of #3115

@ealsur ealsur marked this as a duplicate of #3115 Jan 19, 2024
@ealsur ealsur added bug Something isn't working ChangeFeed labels Jan 19, 2024
@kundadebdatta kundadebdatta self-assigned this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ChangeFeed customer-reported Issue created by a customer needs-investigation
Projects
None yet
Development

No branches or pull requests

3 participants