Akka Http Code vrs Spring Boot Application -
i new akka http, moved spring boot application akka http seeing actor model benefits facing 1 issue.
max-connection property in spring boot allows set max connection property spring boot application, not able set in new akka http application.
fyi: developed new application using akkahttp performance comparison reports akkahttp less springboot application in terms of max connection , response time. testing used jmeter put load in both application 2000 user per second akkahttp code bad , spring boot awesome. during analysis figured out 1 property max-conection have configured in spring-boot enhancing it's performance.
how set in akkahttp? can 1 me work around.
note: have seen configuration akkahttp code http://doc.akka.io/docs/akka-http/10.0.9/scala/http/configuration.html not able figure out how use it.
thanks
file based configuration
as indicated in link provided:
usually means provide application.conf contains application-specific settings differ default ones provided reference configuration files individual akka modules.
in sbt based projects directory structure looks like:
/projectdir /build.sbt /resources /application.conf /src /main /scala
in /projectdir/resources/application.conf
can add configuration:
akka.http { max-connections = 42 }
this automatically picked up actorsystem
:
this means default parse application.conf, application.json , application.properties found @ root of class path—please refer aforementioned documentation details.
code based configuration
you can specify parameter in code well:
val config : config = configfactory parsestring """akka.http.max-connections = 42"""
and use config create actorsystem:
implicit val actorsystem = actorsystem("actorsystemname", config) implicit val materializer = actormaterializer() val bindingfuture = http().bindandhandle(...)
Comments
Post a Comment