scala - 如何知道,如果配置已加载

标签 scala akka akka-http

我正在使用 akka http websocket client并希望让客户保持活力。
在 Automatic keep-alive Ping support 部分,它说,将配置放入 application.conf 如下:

akka.http.client.websocket.periodic-keep-alive-mode = pong

我已经这样做了:
akka.http {
  websocket {
    # periodic keep alive may be implemented using by sending Ping frames
    # upon which the other side is expected to reply with a Pong frame,
    # or by sending a Pong frame, which serves as unidirectional heartbeat.
    # Valid values:
    #   ping - default, for bi-directional ping/pong keep-alive heartbeating
    #   pong - for uni-directional pong keep-alive heartbeating
    #
    # See https://tools.ietf.org/html/rfc6455#section-5.5.2
    # and https://tools.ietf.org/html/rfc6455#section-5.5.3 for more information
    periodic-keep-alive-mode = ping

    # Interval for sending periodic keep-alives
    # The frame sent will be the onne configured in akka.http.server.websocket.periodic-keep-alive-mode
    # `infinite` by default, or a duration that is the max idle interval after which an keep-alive frame should be sent
    periodic-keep-alive-max-idle = infinite
  }
} 

如何确定配置是否被采用?

最佳答案

我不确定我是否真的理解您的问题,但是您可以通过设置 akka.log-config-on-start 在加载 Actor 系统时显示完整的配置(包括覆盖等)。到。

Akka Docs on Logging the Configuration

related stackoverflow

关于scala - 如何知道,如果配置已加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55728734/

相关文章:

scala - Akka-Http 2.4.9 抛出 java.lang.NoClassDefFoundError : akka/actor/ActorRefFactory exception

scala - 流式传输由其他流组成的文件

Scala 模式匹配语法

java.lang.NoClassDefFoundError : com/typesafe/config/Config while running akka-quickstart-java in STS

scala - 如何检测 Akka Actor 何时完成?

apache-spark - Apache Spark 与 Akka

scala - Spray、Akka-http 和 Play,这是新 HTTP/REST 项目的最佳选择

scala - Spark 按列值分区数据集

java - 如何在scala代码中引用MyClass::new?

scala - 使用Actor池有意义吗?