简体   繁体   English

Akka 不加载 application.conf

[英]Akka doesn't load application.conf

I am trying to set a different akka.http.parsing.max-chunk-size我正在尝试设置不同的akka.http.parsing.max-chunk-size

My application.conf is in src/resources/ and looks like this:我的 application.conf 在 src/resources/ 中,如下所示:

akka.http {
   parsing {
       max-chunk-size=20m
   }
}

I am using this code in my main to set up my system:我在主程序中使用此代码来设置我的系统:

val conf = ConfigFactory.load()
implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer() 
implicit val executionContext = system.dispatcher

However I still get this error when trying to make a big get request:但是,在尝试发出大的 get 请求时,我仍然收到此错误:

akka.http.scaladsl.model.EntityStreamException: HTTP chunk size exceeds the configured limit of 1048576 bytes

EDIT: I have tried relocating the file based on the answer I got, however i still get the same error.编辑:我尝试根据我得到的答案重新定位文件,但是我仍然遇到相同的错误。 My program structure looks like this:我的程序结构是这样的:

├── main
│   ├── resources
│   │   └── application.conf
│   └── scala
│       ├── program
│       │   ├── BackTester.scala
│       │   ├── Main.scala
│       │   └── StrategyExecutor.scala
│       ├── strategies
│       │   ├── BollingerBandStrategy.scala
│       │   ├── CrossingSMAStrategy.scala
│       │   ├── RSIStrategy.scala
│       │   ├── StochasticStrategy.scala
│       │   └── TradingStrategies.scala
│       └── util
│           ├── Interval.scala
│           ├── JsonParser.scala
│           ├── Time.scala
│           ├── barseries
│           │   └── barSeriesBuilder.scala
│           └── requests
│               └── Fetcher.scala
└── test
    └── scala

I looked at the official website and it looks like the configuration is correct ( https://doc.akka.io/docs/akka-http/current/configuration.html ).我查看了官网,看起来配置是正确的( https://doc.akka.io/docs/akka-http/current/configuration.html )。 I would put inside an specific application into the application.conf file.我会将一个特定的应用程序放入 application.conf 文件中。 Like this example here below.就像下面的这个例子。

routersDemo {
  akka {
    actor.deployment {
      /poolMaster2 {
        router = round-robin-pool
        nr-of-instances = 5
      }

      /groupMaster2 {
        router = round-robin-group
        routees {
          paths = ["/user/slave_1","/user/slave_2","/user/slave_3","/user/slave_4","/user/slave_5"]
        }
      }
    }
  }
}

And then call it at the ConfigFactory然后在 ConfigFactory 中调用它

    val system = ActorSystem("routersDemo", ConfigFactory.load().getConfig("routersDemo"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM