Skip to content

Server sent events (SSE) with spring boot have a wrong behavior #33541

@gengyunmaster

Description

@gengyunmaster

According to [Asynchronous Requests :: Spring Framework](https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-ann-async.html) , I wrote a spring boot application to handle server sent events (SSE). Unfortunately, client can't receive message from server instantly, it can receive message until the SSE connection closed (timed out or the backend spring boot application exit). I have posted this problem to [spring-projects/spring-boot: Spring Boot (github.com)](spring-projects/spring-boot#42315) and [Server sent events (SSE) with spring boot have a wrong behavior - Stack Overflow](https://stackoverflow.com/questions/78985741/server-sent-events-sse-with-spring-boot-have-a-wrong-behavior) , but I believe this case should be a bug of spring framework or, at least, the documentation and error detection during compiling process should be enhanced.

To reproduce the problem, simply download the zip file I submitted, use maven to compile the project in "demo" directory and use nginx as a reverse proxy server to handle the project in "nginx" directory.
sse.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions