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

Adding resiliency around using asynchronous request #2027

Open
Hubert-Heijkers opened this issue Nov 11, 2024 · 4 comments
Open

Adding resiliency around using asynchronous request #2027

Hubert-Heijkers opened this issue Nov 11, 2024 · 4 comments
Assignees
Labels
Protocol Protocol, URL Conventions V4.02

Comments

@Hubert-Heijkers
Copy link

When executing request asynchronously the client depends on receiving the [202] response from the service containing the location header to the status monitor URL. And once this status monitor URL is interrogated using a GET request against it the standard allows for a different status monitor URL to be returned to continue the loop, creating another possibility for the client not to receive the response and loosing access to the final results of the asynchronously executed, potentially/typically long running, request.

The client would therefore have a deterministic way to determine the location of the status monitor resource which likely implies that the client would also need to be able to provide a unique ID, a UUID (or GUID) presumably, to identify the asynchronous operation.

@Hubert-Heijkers Hubert-Heijkers added Protocol Protocol, URL Conventions V4.02 labels Nov 11, 2024
@Hubert-Heijkers
Copy link
Author

A thought that has been discussed is to link the asynchronous job to the request that initiated it and allow the requester to specify the X-Request-ID header, which would then become the ID of the asynchronous operation, and in the case of TM1 the ID used in the ./_async(<<x-request-id>>) resource monitor URL.

As a result of this the resource monitor URL of a given asynchronous operation would have to become a stable ID and even if the a client did not specify a request ID we would propose that it would become stable after that as that way one could store these and re-interrogate them later.

@ralfhandl ralfhandl moved this to Open in OData TC Nov 12, 2024
@ralfhandl
Copy link
Contributor

Could Repeatable Requests help achieving resiliency instead of a constructable monitor resource URL?

@Hubert-Heijkers
Copy link
Author

The issue is that the requests that are being executed asynchronously are by themselves not repeatable but we'd want to have a, similar perhaps, pattern to figure out if by any chance the request is, or has been executing asynchronously to not have to do it again.

But I'm guessing what you are saying is if you execute a repeatable request, irrespective of it being executed asynchronously or not, a service could perhaps figure out using the Repeatable Requests pattern the request has, or potentially is still, been executed and if the respond-async preference is being repeated it could even respond similarly on the repeat of the request.

@ralfhandl
Copy link
Contributor

Annotate $metadata with something like

@TM1.monitorResourceUrlTemplate: "./_async({x-request-id})"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Protocol Protocol, URL Conventions V4.02
Projects
Status: Open
Development

No branches or pull requests

2 participants