Resteasy mutiny : multi subscription not cancelled if the request is cancelled from browser.
See original GitHub issueDescribe the bug
When using resteasy with mutiny, I am sending an infinite stream as output and have opened the endpoint in the browser
http://localhost:8080/block/test
After some time I have cancelled the request from browser but the server is still generating data. I am very new to Quarkus and testing out stuff, please correct if I am doing anything wrong. Please check the screenshot for the dependencies used.
@Path("/")
public class ReactiveGreetingResource
{
@Inject
ReactiveGreetingService service;
private static final Logger LOG = Logger.getLogger(ReactiveGreetingResource.class);
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("block/{name}")
public Multi<Long> greeting(@PathParam String name) {
return Multi.createFrom().ticks().every(
Duration.ofSeconds(2)).invoke(x -> {
LOG.info(Thread.currentThread().getName() + "-" + new Date().getSeconds());});
}
}
Expected behavior Multi should stop generating data if the request is cancelled. The subscription should be cancelled on request cancel.
Actual behavior Multi is still generating data even though the request is cancelled.
Screenshots
Environment (please complete the following information):
- Output of
uname -a
orver
: - Output of
java -version
: 11 - GraalVM version (if different from Java): 20.3.0.r11-grl
- Quarkus version or git rev: 1.10.3.Final
- Build tool (ie. output of
mvnw --version
orgradlew --version
):
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.9, vendor: GraalVM Community, runtime: .sdkman/candidates/java/20.3.0.r11-grl
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-46-generic", arch: "amd64", family: "unix"
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to handle failures with Mutiny - Quarkus
If it fails, we recover. But the cancellation only cancels that item, not the full stream, meaning we will receive the next one...
Read more >MultiSubscribe (SmallRye Mutiny 0.12.3 API) - javadoc.io
This method returns a Cancellable to cancel the subscription. This is a "factory method" and can be called multiple times, each time starting...
Read more >quarkus - What is the point of returning a Multi instead of a Uni ...
At the moment, running a query on the database doesn't return a stream and therefore returning a Multi is usually not helpful.
Read more >Home of Quarkus Cheat-Sheet - GitHub Pages
Quarkus is a Kubernetes Native Java stack tailored for GraalVM & OpenJDK HotSpot, crafted from the best of breed Java libraries and standards....
Read more >How to deal with dropped exceptions? - SmallRye Mutiny
The returned Uni is failed with a IOException , but since the subscription itself has been cancelled then there is no way to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@FroMage I am using below dependencies… i have checked with 1.13.6.Final, the issue still exists…
</dependency>issue still exists in RESTEasy but in RESTEasy Reactive is fixed, if you can fix it also for RESTEasy it will be perfect!