scala - 如何在 akka http 上设置 file-io-dispatcher?
问题描述
当我试图开始时,akka
我遇到了这个错误ConfigFactory.load()
:
Exception in thread "main" com.typesafe.config.ConfigException$UnresolvedSubstitution: reference.conf @ jar:file:/home/faoxis/.ivy2/cache/com.typesafe.akka/akka-http_2.12/jars/akka-http_2.12-10.1.5.jar!/reference.conf: 51: Could not resolve substitution to a value: ${akka.stream.blocking-io-dispatcher}
在源代码中我发现了这个:
# Fully qualified config path which holds the dispatcher configuration
# to be used by FlowMaterialiser when creating Actors for IO operations.
file-io-dispatcher = ${akka.stream.blocking-io-dispatcher}
我有一个问题。我可以在不使用环境变量的情况下使用一些默认设置akka.stream.blocking-io-dispatcher
吗?也许我可以设置application.conf
?
解决方案
你唯一能做的application.conf
就是Environment Variables
覆盖定义在reference.conf
.
因此,您可以akka.stream.blocking-io-dispatcher
在其中任何一个中进行配置。
奇怪的是通常有一个默认值设置。我akka-http
与 Play 一起使用,我从来不需要设置任何配置。
请参阅此处的akka-streams
配置:流配置
推荐阅读
- cuda - 挣扎于 CUDA、Clang 和 LLVM IR,并得到:CUDA 故障:'无效的设备功能'
- amazon-cloudformation - ElasticsearchClusterConfig 中的条件
- json - 带回车的表格输出和 jq
- python - 如何使用消息框在 tkinter 中显示用户的输入?
- python - 从字符串中删除每隔一个逗号(python)
- vue.js - vue.js 有条件地导入 mixin
- c - 将 uint16_t 转换为 unsigned int
- linux - 如何将我的程序的菜单栏注册到 KDE Plasma 的全局菜单小部件?
- jquery - Kendo Grid MVC 内联编辑基于其他下拉列表自动选择下拉列表值
- python - 仅使用 cmd 安装 Python 并自动添加到路径