如果配置已加载,如何知道
How to get know, if the configuration is loaded
我正在使用 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
}
}
如何判断配置是否被采用?
我不确定我是否真的理解你的问题,但你可以在加载 actor 系统时通过将 akka.log-config-on-start
设置为 on 来显示完整的配置(包括覆盖等)。
Akka Docs on Logging the Configuration
related Whosebug
我正在使用 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
}
}
如何判断配置是否被采用?
我不确定我是否真的理解你的问题,但你可以在加载 actor 系统时通过将 akka.log-config-on-start
设置为 on 来显示完整的配置(包括覆盖等)。
Akka Docs on Logging the Configuration
related Whosebug