Webflux 流式处理 Nginx 异常
Webflux streaming Nginx exception
我有 Spring Cloud SSE #webflux 流媒体服务,我的前台通过 Nginx 连接它。有时我有这个:
Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
the server responded with a status of 504 (Gateway Timeout)
具有重试的事件源重新连接并且有效。
前端代码是这样的
this.source = new EventSource("/comment/stream", { });
this.source.addEventListener("message", function (event)
后端
@GetMapping(path = "/comment/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Comment> feed() {
return this.commentRepository.findAll();
}
配置 netty 超时没有帮助。
来自此流媒体服务前面的 spring 云网关的实时超时 60s。
我有 Spring Cloud SSE #webflux 流媒体服务,我的前台通过 Nginx 连接它。有时我有这个:
Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
the server responded with a status of 504 (Gateway Timeout)
具有重试的事件源重新连接并且有效。
前端代码是这样的
this.source = new EventSource("/comment/stream", { });
this.source.addEventListener("message", function (event)
后端
@GetMapping(path = "/comment/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Comment> feed() {
return this.commentRepository.findAll();
}
配置 netty 超时没有帮助。
来自此流媒体服务前面的 spring 云网关的实时超时 60s。