如何知道是否已加载配置

时间:2019-04-17 13:30:47

标签: scala akka akka-http

我正在使用akka http websocket client,并希望保持客户端的生命。
在“自动保持活动的Ping支持”部分中,将配置按如下所示放入 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
  }
} 

如何确定是否进行了配置?

1 个答案:

答案 0 :(得分:4)

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

Akka Docs on Logging the Configuration

related stackoverflow