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
6
votes
2 answers

Http Websocket as Akka Stream Source

I'd like to listen on a websocket using akka streams. That is, I'd like to treat it as nothing but a Source. However, all official examples treat the websocket connection as a Flow. My current approach is using the websocketClientFlow in combination…
Rea Sand
  • 163
  • 9
6
votes
1 answer

How to send HTTP request using Akka with SSL certificates

I am having some trouble configuring Akka HTTP to use specific SSL certificates when making HTTP requests from Scala. I can make non-SSL-based requests without hiccups, but cannot seem to find proper examples on how to configure Akka for use with a…
6
votes
2 answers

How do I extract a Future[String] from an akka Source[ByteString, _]?

I am attempting to stream a file using akka streams and am running into a small issue extracting the results of the stream into a Future[String]: def streamMigrationFile(source: Source[ByteString, _]): Future[String] = { var fileString = "" val…
Reece Long
  • 437
  • 1
  • 4
  • 13
6
votes
4 answers

Websocket Proxy using Play 2.6 and akka streams

I'm trying to create a simple Proxy for Websocket connections using Play and akka streams. The traffic flow is like this: (Client) request -> -> request (Server) Proxy (Client) response <- <- response…
morgan freeman
  • 6,041
  • 3
  • 25
  • 32
6
votes
2 answers

Is connection pooling in akka-http using the source queue Implementation thread safe?

Refering to the following implementation mentioned in: http://doc.akka.io/docs/akka-http/10.0.5/scala/http/client-side/host-level.html val poolClientFlow = Http().cachedHostConnectionPool[Promise[HttpResponse]]("akka.io") val queue = …
Niv-Nik
  • 61
  • 2
6
votes
2 answers

akka-http no stack trace or details on error

I got a structure which can basically be summarized as: outside user makes a rest request to akka-http server akka-http makes a request(query?) to a (some)data source using asynchttpclient akka-http transforms the result from asynchttpclient and…
kali
  • 1,143
  • 1
  • 9
  • 26
6
votes
1 answer

Akka websocket - how to close connection by server?

So here is my websocket server implementation. val route = get { pathEndOrSingleSlash { handleWebSocketMessages(websocketFlow) } } def websocketFlow: Flow[Message, Message, Any] = Flow[Message] .collect { case…
Norbert Orzechowicz
  • 1,329
  • 9
  • 20
6
votes
2 answers

Akka-Http load css&js resources

I want to use akka-http like http server (for example tomcat or nginx server) . with this simple code can load html sources from web browsers but can not load other source linked on html file . import akka.actor.ActorSystem import…
mah454
  • 1,571
  • 15
  • 38
6
votes
1 answer

Using Akka Http for Multiple Bindings

Using akka http to bind to a port and then route incoming connections is easy enough given the documentation. One question not addressed is how to bind multiple ports for different routes. If I have multiple specifications: val route1 :…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
6
votes
3 answers

Can Akka-HTTP do HTTP/2.0?

sounds like a straightforward question, but i cannot find the answer (probably because the '2.0' is interpreted as Akka's version when searching for 'how to do HTTP/2.0 with Akka-HTTP'). it seems like akka-http does have a construct for…
Ehud Kaldor
  • 753
  • 1
  • 7
  • 20
6
votes
1 answer

Scala akka-http WebSocket: How to save the client connection and push message to the client when needed?

How to keep the client (web) connection in a memory variable and then send outgoing messages to the client (web) when needed? I already have some simple code for pushing back message to the client once the server receives messages from the client.…
lichgo
  • 523
  • 1
  • 6
  • 16
6
votes
1 answer

How to set content type?

I use akka http client 2.4.6 to post a json to server (server requires message's content type to be applicaton/json to handle): val request = HttpRequest(uri = "http://localhost:9000/auth/add-user", method = HttpMethods.POST, entity…
mmdc
  • 1,677
  • 3
  • 20
  • 32
6
votes
1 answer

how can I count akka current open connections

I'm looking into akka http "com.typesafe.akka" %% "akka-actor" % "2.4.6", "com.typesafe.akka" % "akka-http-experimental_2.11" % "2.4.6" I'm testing the simple code, as below. My main question is how is it possible to enhance it to get also…
Julias
  • 5,752
  • 17
  • 59
  • 84
6
votes
1 answer

How to send a message in a reactive stream from a subscriber to a publisher in a web socket connection

My application has an Akka-Websocket interface. The web socket consists of an actor-subscriber and an actor publisher. The subscriber handles commands, by sending them to the corresponding actor. The publisher listens on the event stream and…
fs123
  • 73
  • 5
6
votes
0 answers

Akka-Http WWW-Authenticate rendering without quotes

In my akka-http application I am returning a response from another security service that responds with a WWW-Authenticate header: When akka-http parses this header and then renders the WWW-Authenticatevalue to a string the quotes on one of the…
JoshG
  • 91
  • 3