Unhandled reactor.core.Exception OverflowException: Queue is full?!
See original GitHub issueWhile I’m playing around with the new reactive features in Spring Boot v2.0.0.BUILD-SNAPSHOT I have noticed that when I multiple time force close the connection to endpoint like this:
@GetMapping(produces = MediaType.TEXT_EVENT_STREAM_VALUE, value = "/events")
public Flux<Event> getEvents()
{
return Flux.from(new Publisher<Event>() {
@Override
public void subscribe(Subscriber<? super Event> subscriber) {
while (true) {
try {
new Thread().sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
subscriber.onNext(new Event(1, new Date()));
}
}
});
}
Spring throws: “reactor.core.Exceptions$BubblingException: reactor.core.Exceptions$OverflowException: Queue is full?!” and after that when I call the endpoint again it freeze. Here I’ve created a repo https://github.com/georgi-staykov/reactive-demo where you can find example code and video that shows the bug.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Composed Function Support with spring cloud stream throw ...
OnAssembly.1 reactor.core.Exceptions$OverflowException: Queue is full: Reactive Streams source doesn't respect backpressure at reactor.core.
Read more >Exceptions (reactor-core 3.5.0)
A common error message used when a reactive streams source doesn't seem to respect backpressure signals, resulting in an operator's internal queue to...
Read more >Handling Exceptions in Project Reactor - Baeldung
In this tutorial, we'll look at several ways to handle exceptions in Project Reactor. · The simplest way to handle an Exception is...
Read more >Answered: Queue Exceptions: Modify the static… | bartleby
Define a queue overflow exception and modify enqueue so that it throws this exception when the queue runs out of space. Define a...
Read more >reactor.core.Exceptions$OverflowException.<init> java code ...
public static IllegalStateException failWithOverflow() { return new OverflowException("The receiver is overrun by more signals than expected (bounded queue.
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

There are many problems with this sample. To start it’s not a Reactive Streams compliant
Publishersince it callsonNextbefore callingonSubscribeand then completely ignores back-pressure by pushing items without a corresponding request for items from the Subscriber (i.e. the server). It also blocks the current thread which will quickly kill it (with a few concurrent users) that’s running event-loop style with just a few threads based on the number of cores.The whole point of using Reactor
Fluxis that you don’t have to implementPublisherfrom scratch. UseFlux#createor for this scenario useFlux#interval.I don’t know either but it’s not in spring boot and freezing a thread in such environment is just wrong.