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
3
votes
1 answer

I want to shorten the route in Akka Http

I am new to Akka HTTP and I wanted to make route for this -> server/company/:company/authority/:authority/user/:user/region/:region/:regionId/:planTypes I have made a route like this -> val route: Route = get { pathPrefix("/server") { …
Not_Human
  • 45
  • 4
3
votes
1 answer

How to keep my incoming websocket connection open all the time?

I connected to my websocket service using this sample code client, but currently it just connects and then shutsdown. How can I keep this connection open and never close it? Once I make a connection, I want it to remain open until I shutdown the…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
3
votes
0 answers

Editing the Metadata of HttpRequest for Akka GRPC Authentication

Akka-grpc documentation provides a basic example of adding authentication through Akka-http. At the end, it suggests that the authentication result can be embedded in the metadata of the HttpRequest and can be accessible in the grpc service methods…
zmerr
  • 534
  • 3
  • 18
3
votes
2 answers

Send JSON in request OkHttp

Friends! I have a simple HTTP request: void postRequest(String postUrl,String phone, String message) throws IOException { OkHttpClient client = new OkHttpClient(); //RequestBody body = RequestBody.create(JSON, postBody); RequestBody…
Mardaunt
  • 82
  • 1
  • 13
3
votes
0 answers

How do I get Akka HTTP to backpressure using connection pooling?

I'm running Akka Streams Typed 2.6.9 with Akka HTTP 10.1.12 in a service running in AWS ECS and I'm getting the error message "Exceeded configured max-open-requests value of 32" in my streaming application. I've looked for answers and must have…
Brad
  • 2,261
  • 3
  • 22
  • 32
3
votes
1 answer

Streaming case class objects from a scala Play server using chunked transfer encoding

So, I'm using Play framework 2.7 to setup a streaming server. What I'm trying to do is stream about 500 custom case class objects that are all of similar size. This is part of the controller that generates the stream - def generate:…
gravetii
  • 9,273
  • 9
  • 56
  • 75
3
votes
1 answer

how to make several request to websocket server using akka client side websocket

i am new to akka websockets and learning akka client side websockets https://doc.akka.io/docs/akka-http/current/client-side/websocket-support.html i am using websockets for my webrtc janus server for that i have URL and i need to send many messages…
swaheed
  • 3,671
  • 10
  • 42
  • 103
3
votes
1 answer

How to conditionally add route paths in akka-http?

I've got a series of paths that look like; path("slides" / Segment) { segment => getFromDirectory(s"${cfg.slidesDir}/$segment") } ~ path("foo" / Segment) { segment => getFromDirectory(s"${cfg.mypyPursDir}/$segment") } ~ path("foo" / "images" /…
bbarker
  • 11,636
  • 9
  • 38
  • 62
3
votes
1 answer

How can I resolve conflicting actor systems while testing akka-http and akka actors at the same spec file?

I have a Route defined using akka-http that uses an actor inside to send messages. My route looks like this: path("entity") { post { entity(as[Enrtity]) { entity => val result: Future[Message] =…
Esildor
  • 169
  • 3
  • 10
3
votes
1 answer

Forwarding (Downloading/Uploading) Large File via Akka HTTP / Akka Streams

I have a service that takes an HttpRequest from a client to get a file from another server via REST and then forward the file to the client as an HttpResponse. Don't ask me why the client doesn't ask for the file him/herself because that is a long…
locorecto
  • 1,178
  • 3
  • 13
  • 40
3
votes
1 answer

akka-http web-app fails to start on minimal docker jre 11 (what java modules for scala12 akka-http)?

I'm trying to Dockerize my (otherwise running nice) very small akka-http webapp. I'm using the buildfile indicated here. For convenience added: FROM alpine:latest as packager RUN apk --no-cache add openjdk11-jdk openjdk11-jmods ENV…
dr jerry
  • 9,768
  • 24
  • 79
  • 122
3
votes
1 answer

type mismatch error in akka dsl route directive

I'm setting up a rest controller with akka http. The controller parses the url, extracts variables, then calls a service which sends a message to an actor, which then queries a repository and sends the data as a message. I finally got the actor to…
Boris
  • 716
  • 1
  • 4
  • 25
3
votes
3 answers

Adding headers to an Akka HTTP HttpRequest

I have an existing Akka HTTP HttpRequest and I want to add two headers to it. val req: HttpRequest = ??? val hs: Seq[HttpHeader] = Seq(RawHeader("a", "b")) req.addHeaders(hs) Expected: a new HttpRequest object with the additional…
akauppi
  • 17,018
  • 15
  • 95
  • 120
3
votes
1 answer

Dynamic PathMatcher from String

I have a test server that takes expectations at runtime and responds accordingly when the expectation is called. The expectations are stored in state. Here's the route: val route: Route = ctx => { val routes = state.map { case (pathString,…
Synesso
  • 37,610
  • 35
  • 136
  • 207
3
votes
1 answer

Akka streams Source.repeat stops after 100 requests

I am working on the below stream processing system to grab frames from one source, process, and send to another. I'm using a combination of akka-streams and akka-http through their scapa api. The pipeline is very short but I can't seem to locate…
Andrew
  • 154
  • 10