-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Re-subscription must re-trigger the operation #10810
Re-subscription must re-trigger the operation #10810
Conversation
Is it something that should go in 1.6.1? |
BTW, I believe that the Resteasy Single/Maybe support has the same bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but perhaps it's worth documenting this behaviour difference ?
Yes, it deserves to be mentioned in the doc. I will add a sentence tomorrow. |
When an operation returns a Uni, resubscribing to this Uni must re-execute the underlying operation (except if the user explicitly uses cache()). As RestEasy uses CompletionStage behind the scene, this behavior was not working and was always returning the same CompletionStage (the initial one). As a consequence, resubscriptions and retries were not working. This commit changes how the Unis are created to re-execute the operation on every subscription. Note that it also delays the initial execution until the first subscription.
866f264
to
6ff0c0a
Compare
@FroMage I've added a bit of text in the documentation. |
When an operation returns a Uni, resubscribing to this Uni must re-execute the underlying operation (except if the user explicitly uses cache()).
As RestEasy uses CompletionStage behind the scene, this behavior was not working and was always returning the same CompletionStage (the initial one). As a consequence, resubscriptions and retries were not working.
This PR changes how the Unis are created to re-execute the operation on every subscription. Note that it also delays the initial execution until the first subscription.