【问题标题】:Server Side Events on OpenShift times out (HTTP 504OpenShift 上的服务器端事件超时(HTTP 504
【发布时间】:2021-11-23 14:58:16
【问题描述】:

我有一个提供 REST API 的 Spring Boot 应用程序。其中一个端点是流(服务器端事件):

    @GetMapping(path = "/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
      public Flux<ServerSentEvent<?>> stream() {
      ...
    }

在本地这工作正常。但是,当我在 OpenShift 集群上部署它时,我总是收到 HTTP 错误 504。其他“正常”REST 端点在操作系统上运行良好。

在 OpenShift 配置中我需要考虑什么?网络?

【问题讨论】:

    标签: spring-boot spring-mvc openshift


    【解决方案1】:

    问题是我 30 秒的心跳间隔太长了。 15 秒就可以工作了。

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2012-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-01
    • 2014-10-19
    • 2018-05-28
    • 2013-07-15
    • 1970-01-01
    相关资源
    最近更新 更多