akka-http

akka-http not showing metrics in NewRelic

我只是一个虾纸丫 提交于 2020-01-07 01:49:29
问题 I'm trying to monitor my akka-http Rest web-service with NewRelic The application has only one GET url (defined with akka-http) I have the following configuration in the plugins.sbt logLevel := Level.Warn addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.4") addSbtPlugin("com.gilt.sbt" % "sbt-newrelic" % "0.1.4") I have the following configuration in the build.sbt scalaVersion := "2.11.7" name := "recommender-api" ...blablabla... libraryDependencies += "com.typesafe.akka" % "akka

type mismatch with akka.http.scaladsl.server.Route

偶尔善良 提交于 2020-01-06 06:37:10
问题 I've created a http server with akka http as follows: import akka.actor.typed.{ActorRef, ActorSystem} import akka.http.scaladsl.Http import akka.http.scaladsl.server.Route import com.sweetsoft.LoggerActor.Log import akka.actor.typed.scaladsl.adapter._ import akka.http.scaladsl.Http.ServerBinding import akka.http.scaladsl.model._ import com.sweetsoft._ import akka.http.scaladsl.server.Directives._ import akka.stream.typed.scaladsl.ActorMaterializer import scala.concurrent.Future object

type mismatch with akka.http.scaladsl.server.Route

爱⌒轻易说出口 提交于 2020-01-06 06:36:08
问题 I've created a http server with akka http as follows: import akka.actor.typed.{ActorRef, ActorSystem} import akka.http.scaladsl.Http import akka.http.scaladsl.server.Route import com.sweetsoft.LoggerActor.Log import akka.actor.typed.scaladsl.adapter._ import akka.http.scaladsl.Http.ServerBinding import akka.http.scaladsl.model._ import com.sweetsoft._ import akka.http.scaladsl.server.Directives._ import akka.stream.typed.scaladsl.ActorMaterializer import scala.concurrent.Future object

Loading static html files using Akka-http Java

人走茶凉 提交于 2020-01-05 05:48:12
问题 I've been struggling to get a static file to load from a simple aka-http Java server. I've tried a number of options, but I always get the following error: [ERROR] [09/07/2018 11:52:06.258] [AkkaRestApiApp-akka.actor.default-dispatcher-4] [akka.actor.ActorSystemImpl(AkkaRestApiApp)] Error during processing of request: 'java.lang.NullPointerException (No error message supplied)'. Completing with 500 Internal Server Error response. To change default exception handling behavior, provide a custom

Play Framework test helpers need implicit `Materializer`

若如初见. 提交于 2019-12-30 10:35:02
问题 I'm using Play 2.6.x and the test helper for status(result) has the method: def status(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Int = status(of.run()) Running tests throws when the compiler can't find the implicit value: could not find implicit value for parameter mat: akka.stream.Materializer What is the Materializer -- I'm assuming it's part of Akka-HTTP And how can I provide one? 回答1: From akka streams docs: The Materializer is a factory for

How to create akka-http client with backpressure overflow strategy?

青春壹個敷衍的年華 提交于 2019-12-24 18:42:43
问题 I have undefined amount of akka-http client flows downloading data from an http service. I'm using akka-http host-level connection pooling because I would like to customise the pool, since there are long running requests going through it. Since, the number of clients is undefined and dynamic, I don't know how to configure the connection pool (max-open-requests/max-connections). Additionally, I might want the connection pool to be small (less than number of clients) to not damage the bandwidth

Exceeded configured max-open-requests

一个人想着一个人 提交于 2019-12-24 13:38:31
问题 recently I started to build some small web processing service using akka streams. It's quite simple, I'm pulling urls from redis, then I'm downloading those urls(they are images) later I'm processing images, and pushing them to s3 and some json to redis. I'm downloading lot of different kinds of images from multiple sites, I'm getting whole bunch of errors like 404, Unexpected disconnect , Response Content-Length 17951202 exceeds the configured limit of 8388608, EntityStreamException: Entity

Akka-http POST results in “The server-side HTTP version is not supported”

两盒软妹~` 提交于 2019-12-24 12:09:32
问题 I have an issue when trying to do a simple POST request to some internal endpoint using akka-http. When this piece of code is executed: for { request <- Marshal(merchantTransactionRequest).to[RequestEntity] response <- Http().singleRequest( HttpRequest( method = HttpMethods.POST, uri = "http://foo/bar:8080", entity = request.withContentType(ContentTypes.`application/json`) ) ) ... } yield ... I get greeted with the following error: akka.http.scaladsl.model.IllegalResponseException: The server

Akka-http POST results in “The server-side HTTP version is not supported”

牧云@^-^@ 提交于 2019-12-24 12:08:01
问题 I have an issue when trying to do a simple POST request to some internal endpoint using akka-http. When this piece of code is executed: for { request <- Marshal(merchantTransactionRequest).to[RequestEntity] response <- Http().singleRequest( HttpRequest( method = HttpMethods.POST, uri = "http://foo/bar:8080", entity = request.withContentType(ContentTypes.`application/json`) ) ) ... } yield ... I get greeted with the following error: akka.http.scaladsl.model.IllegalResponseException: The server

Deploying Akka HTTP to Azure

一世执手 提交于 2019-12-24 10:53:11
问题 I was looking for some info on how to deploy Akka Http app to Azure. Azure supports Java Web Apps, but I assume it does only for apps that run in TomCat or alike. But Akka Http is a standalone application - is there any support for that and in any case, how should I proceed with it? I am aware of sbt-native-packager that can produce various installable formats, but seeing how easy it is to deploy .NET app from Visual Studio, I would love to see a simpler way for Java as well. 回答1: Based on my