You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was curious about how to retry requests in middleware. I did see #546 but it was inconclusive.
The use case we have in mind is transaction management. We use a middleware to be our transaction boundary and this has worked well over the years, and considerably cleaned up our code from having the transactions done at other layers.
Spurious transaction retries are handled by our service mesh following standard REST semantics (DELETE, PUT and GET are retriable), etc....
We do have some cases where retrying POST might make sense, but it's hard to do in the service mesh layer.
Description
I was curious about how to retry requests in middleware. I did see #546 but it was inconclusive.
The use case we have in mind is transaction management. We use a middleware to be our transaction boundary and this has worked well over the years, and considerably cleaned up our code from having the transactions done at other layers.
Spurious transaction retries are handled by our service mesh following standard REST semantics (DELETE, PUT and GET are retriable), etc....
We do have some cases where retrying POST might make sense, but it's hard to do in the service mesh layer.
It'd be nice if we could call Next() more than once, but the issue is that c.index isn't reset to the current value when Next() returns here https://github.com/gin-gonic/gin/blob/master/context.go#L186 .
It seems like a small refactoring would maybe make that possible, but maybe I'm on the wrong track.
The text was updated successfully, but these errors were encountered: