Questions tagged [akka-http]

The purpose of the Akka HTTP layer is to expose Actors to the web via HTTP and to enable them to consume HTTP services as a client. It is not an HTTP framework, it is an Actor-based toolkit for interacting with web services and clients.

The purpose of the Akka HTTP layer is to expose Actors to the web via HTTP and to enable them to consume HTTP services as a client. It is not an HTTP framework, it is an Actor-based toolkit for interacting with web services and clients.

More Info:

1489 questions
0
votes
1 answer

How to subscribe websockets to actor's messages using Akka Streams and Akka HTTP?

I want to send notifications to clients via websockets. This notifications are generated by actors, hence I'm trying to create a stream of actor's messages at server startup and subscribe websockects connections to this stream (sending only those…
gabrielgiussi
  • 9,245
  • 7
  • 41
  • 71
0
votes
1 answer

akka-http how to accept invalid URI [will not solve]

I am developing a service that is called on one path with different query parameters. I have bind a Route to Http: val route: Route = { get { pathPrefix("myRoute"){ parameterMap{ params => complete( …
0
votes
1 answer

In akka-http how to get a List[HttpRequest] from a Route?

In akka-http since the following case HttpRequest(GET, Uri.Path("/ping"), _, _, _) => HttpResponse(entity = "PONG!") can also be written as val route: Route = path("ping") { complete("PONG!") } Is it possible to get…
user794783
  • 3,619
  • 7
  • 36
  • 58
0
votes
1 answer

How to prevent WWW-Authenticate header in response with authenticateBasicAsync directive?

When using the authenticateBasicAsync, how can the WWW-Authenticate response header be omitted? The problem is that a Javascript api (ajax) is calling the akka-http service and the browser is displaying login window when auth fails. Thanks!
user1661898
  • 167
  • 1
  • 8
0
votes
0 answers

RequestContext.complete method ask me for Marshaller - Akka Http with Java

I'm trying to print a simple post value in High Level Server based on Akka Http with java, but when I call ContextRequest.complete method, it ask me for Marshaller. (I'm relied on the following documentation example): This is my…
Federico Saenz
  • 512
  • 1
  • 6
  • 21
0
votes
0 answers

String interpolation in logRequest and logResult in akka-http

I am using akka-http + the directives logRequest + logResult I have something along those lines def entryPoint() = { val sid = UUID.randomUUID().toString logRequest( s" request[$sid]") { logResult(s"response[$sid]") { val…
ccheneson
  • 49,072
  • 8
  • 63
  • 68
0
votes
2 answers

Akka HTTP Actor System

I basically wanted to understand actor model in proper manner. I want to understand what is akka actor, actorsystem, actormaterializer, actorreffactory and dispatcher in the below code. import akka.actor.ActorSystem import…
Shankar Shastri
  • 1,134
  • 11
  • 18
0
votes
1 answer

Akka HTTP responds only to 4 requests

I wrote a simple actor that downloads a web page and sends the body of this page to its sender. I use Akka HTTP for building up the HTTP request and handling the HTTP response. Here is my code: class Downloader(uri: String) extends Actor { import…
0
votes
1 answer

What is the identity element or neutral element for Route Concatenation?

The tilde, ~ is used to concatenate Routes in Akka HTTP. There may be other applications, but my motivating case is wanting to turn a collection of routes into a single route using the ~ operator. To do this, it would be useful to have a "zero"…
vossad01
  • 11,552
  • 8
  • 56
  • 109
0
votes
1 answer

json and cors with akka http

I have a post message. I use akka-http. And I have to call this route from an another server. So I have to add cors with HttpOriginRange.* with ch.megard.akka.http.cors.CorsDirectives. The answer is a json. And I want to have a ContentType…
thomas poidevin
  • 176
  • 2
  • 20
0
votes
1 answer

Can akka HttpHeader store an X-Request-ID or X-Correlation-ID Field?

I'm trying to store/lookup an X-Request-ID in an akka HttpRequest but HttpHeader doesn't appear to have an appropriate subclass. Is it possible to access the X-Request-ID field, or X-Correlation-ID field, in an HttpHeader? According to the…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
0
votes
2 answers

How to send actor a tell message when a URL is accessed?

I am trying to connect the Akka HTTP with the Actors. I have a simple actor which receives "hello" and sends back "Hello world" class TestActor extends Actor{ def receive={ case "hello"=>{ sender!"Hello World" } } } I have defined…
codingsplash
  • 4,785
  • 12
  • 51
  • 90
0
votes
0 answers

different log files with akka-http

I'm a bit confused about logging in akka in general. Currently I have a trait called Logger that are included in any Handlers, etc. I want to log: trait Logger { this: ServiceBase => val log = Logging(system, this) val auditLog = ??? } What I…
Ákos Vandra-Meyer
  • 1,890
  • 1
  • 23
  • 40
0
votes
1 answer

How can I define generic routing in scala akka-http

I wanted to create the reusable the generic routing in Scala Akka-HTTP so that I could use same generic routing for rest of the routing I defined. So far, I could define routing as below that works perfectly. class TestApi(val modules: Configuration…
Sujit Baniya
  • 895
  • 9
  • 27
0
votes
1 answer

akka-http complete response with different types

How can I complete akka-http response with different types based on future response? I am trying to do something like implicit val textFormat = jsonFormat1(Text.apply) implicit val userFormat = jsonFormat2(User.apply) path(Segment) { id => …
igx
  • 4,101
  • 11
  • 43
  • 88