Questions tagged [akka]
Akka is an open-source toolkit and runtime simplifying the construction of concurrent and distributed applications on the JVM. It implements the actor model known from Erlang.
8,132
questions
0
votes
1
answer
35
views
Retry mechanism for GraphStage akka
How can we retry/restart a graphStage in case of failures in postStop() ?
I am relatively new to akka and would really appreciate your help.
Here is what I am trying to do:
source
.via(...
0
votes
1
answer
106
views
Websocket with BlockingQueue subscription
I want to build a GraphQl-like subscription where a client via websocket can ask the Akka Http server to subscribe to updated results from a database and push them back via websocket to the client. My ...
0
votes
1
answer
29
views
Are Actor Model objects the same as domain Entities in an eCommerce system?
Trying to understand Actor Model design.
So in general, actor objects should have behaviour, responsibilities, and state that need to be managed and coordinated with other parts of the system. They ...
0
votes
0
answers
31
views
How to send JSON Response with Status Code in akka-http (Scala)?
I'm new to akka-http and trying to send JSON Response with Status Codes in scala, but I'm able to do that. Help me out. Basically I'm getting error while I send HttpResponse with ContentTypes as JSON.
...
1
vote
0
answers
35
views
How to translate customized generic class Tree[T] to Json with Json annotations?
I want to serialize a genericity Tree[T] with a Json serializer in Akka.
I declare a container Tree[T].
trait NodeId {
def id: Int
}
trait Tree[T <: NodeId] {
def find(id: Int): Option[T]
...
0
votes
0
answers
69
views
Akka Http: set type of service field in IP headers
I would to know if there is a way to set the value of the type of service field in the IP header of the packets sent during an http request.
In the documentation I saw that this field that can be set ...
0
votes
1
answer
48
views
How to list files in a sftp from scala using akka.stream.alpakka.ftp?
In my Scala code I have:
val ftpApi: FtpApi[SSHClient, SftpSettings]
val futureResult = ftpApi.ls(basePath = path, connectionSettings = settings)
this generetes this output:
11:53:36.875 [sshj-...
0
votes
0
answers
17
views
Purpose of optimal-size-exploring-resizer in Akka Classic Routing (scala)
I'm learning Akka Classic Routing. I've learned to use resizer and understood that, but there is one optimal-size-exploring-resizer. I'm unable to understand why we need optimal-size-exploring-resizer ...
1
vote
0
answers
37
views
Delayed Restart is not working while using BackoffSupervisor in Akka Classic Actors (Scala)
I'm trying to use BackoffSupervisor to delay the restart. I've given 10.sec as minimum backoff but on Exception it is restarting the actor immediately.
Here is code:
`object Task2Implementation ...
0
votes
0
answers
31
views
Timeout exception when working with Akka Http
I use following Scala code in my application to get auth token:
def authRequest() : Future[Either[HttpError, HttpMessage]] = {
val http = Http(actorSystem)
val uri = Uri("https://...
1
vote
0
answers
29
views
Dividing Akka source into batches
I have a file parser, something like
def parser(file: File): Source[Record, NotUsed] = ...
and a function that consumes Records:
def send(source: Source[Record, _]: Future[Result]
The files are big, ...
0
votes
1
answer
64
views
Comparing Akka Actors pipToSelf and Future on systems with high throughput and low latency
I have a question regarding pipeToSelf vs Futures.
Suppose we have a Scala backend application that runs on an n2d-standard-16 Google Cloud machine type with 16 cores, where each node hosts a single ...
0
votes
1
answer
21
views
Akka-persistence, event propagation from one actor to another
I have one question about akka-persistence and event migration. I do have read the "Schema Evolution for Event Sourced Actors" chapter. However, this does not give an answer to my question.
...
0
votes
1
answer
69
views
How to know which field is missed while parsing json in Json4s
I have made a generic method which parses json to case class and it also works fine. But if tries to parse big json which have one or two mandatory field then I am not able to figure out which ...
0
votes
1
answer
53
views
Akka Http: Calling TypedActor.context outside of a TypedActor implementation method
I'm trying to build akka http client, by using this example Test akka http client
This is my code:
trait HttpServer {
def sendAndReceive: HttpRequest => Future[HttpResponse]
}
trait ApiHandler ...
0
votes
0
answers
36
views
java.io.IOException: Too many open files from akka.actor.internal-dispatcher
I have a REST API written in Scala with Play framework and Akka, deployed on the production server. Periodically the container with the API crashes with the following error:
[ERROR] [01/18/2023 13:14:...
0
votes
1
answer
181
views
Flink: TaskManager cannot connect to the JobManager - Could not resolve ResourceManager address
I'm using the Apache Flink Kubernetes operator to deploy a standalone job on an Application cluster setup.
I have setup the following files using the Flink official documentation - Link
jobmanager-...
0
votes
0
answers
63
views
Akka Management serving HTTP over HTTPS
I am trying to secure the Akka Management port of a Scala microservice with TLS by starting Akka Management programatically on port 8558 via AkkaManagement:withHttpsConnectionContext().
When the Scala ...
0
votes
1
answer
45
views
Symbol 'type akka.stream.scaladsl.Flow' is missing from the classpath
I'm learning Scala and following this video https://www.youtube.com/watch?v=yU85EowqhY4
But when I tried to run my AkkaHttpJson class I end up getting this error
Symbol 'type akka.stream.scaladsl.Flow'...
0
votes
1
answer
21
views
akka TCP conflate (concat) source stream messages
I have interesting problem with akka TCP streams:
See the code:
package snp.server;
import akka.Done;
import akka.NotUsed;
import akka.actor.ActorRef;
import akka.stream.javadsl.Flow;
import akka....
0
votes
0
answers
57
views
Client send message on tcp socket connection using akka streams
After successfully connected to a tcp socket server, how can i sent the messages to that server?
i have created this client, and is working fine as long as is a two way communication with the server ...
0
votes
1
answer
46
views
IOResult methods deprecated
I am new to Scala and am using the method def process however getting build errors like "method wasSuccessful in class IOResult is deprecated (since 2.6.0): status is always set to Success(Done)
...
0
votes
0
answers
51
views
Is there a framework for distributed job/workers in .net core
I'm working on project that require distributing worker services framework in .net core
description example:
I have a .netcore prime server web app mvc that has a millions of work item to done for ...
1
vote
1
answer
59
views
Scala sbt tests: "No configuration setting found for key 'akka'" after switching to Java 11
After switching to Java 11, sbt tests started to fail with the exception "No configuration setting found for key 'akka'". We are using sbt assembly plugin on the project but since the tests ...
0
votes
2
answers
36
views
Akka TestKit (Java), I want to only consume/expect message object which has some specific string?
I have an Actor, which publish different kind of messages at different events and junit has been written for that using TestKit.
I want to consume message with "specific word" only and skip ...
0
votes
1
answer
38
views
Akka CircuitBreaker - Is it possible to find what caused the circuit breaker to trip?
Is it possible to find what caused the circuit breaker to open? Per Akka documentation https://doc.akka.io/api/akka/current/akka/pattern/CircuitBreakerOpenException.html, the default message "...
0
votes
1
answer
32
views
Akka Typed ActorTestKit - How to send Terminated signal
I have an existing unit test that uses BehaviorTestKit to test the actor's behavior when it receives a Terminated signal. I am able to send a Terminated signal to it like this:
val myParentTestKit = ...
0
votes
2
answers
94
views
Adding values from a Map to an existing Source in Scala
I am using akka streams. Can we add values from a map to an existing source in scala? I want to merge all the values from a Future[Map[String, A]] and a source of A Source[A,_] which are not already ...
1
vote
2
answers
72
views
Akka - Why are stashed messages with backoff supervision lost?
Question
I seem to be observing a scenario in which the messages stashed for a typed supervised actor are lost during a restart, using the Akka backoff supervision strategy.
Is this expected behavior? ...
0
votes
1
answer
117
views
Problems with Incompletely Consumed Akka Streams
We have a service that uses Alpakka 3.0.4 (Scala 2.13) to stream multiple large files from S3, zip them, and send the zipped stream out as HTTP responses. The idea is to start sending out even before ...
1
vote
2
answers
56
views
Not able to execute Akka Work pulling java example provided in the akka document
I am interested in understanding the work pull feature in akka. I am trying to create a main method for the example provided that will create and start the producer(ImageWorkManager class in the ...
0
votes
0
answers
38
views
How can I send a GET request in Akka (Java) and obtain the JSON body of the response?
I have been struggling to simply perform a GET request to the Spotify API and parse the results of the request. I haven't been able to successfully do it despite trying to follow the docs. I am trying ...
1
vote
0
answers
94
views
scala.Some(value) got deserialized into Some(null) if deserialized by using another scala version
I am trying to deserialize an object stream with Scala 2.12.6 which has serialized using scala 2.11.11
Please check below case class which has optional fields.
@SerialVersionUID(123467891598L)
case ...
2
votes
1
answer
64
views
Get ActorRef of a mutiple akka Actor instances by path
I am creating a pool of instances of a same Actor
Later in my app, I want to be able to reference a specific instance of an actor "pool" by its unique path.
val instance1 = context.spawn(...
0
votes
1
answer
78
views
How can I fix "Futures timed out [5 seconds]" and [akkaDeadLetter] errors?
I'm trying to realize numbersPrinter class (the code:
package org.example.actors;
import akka.actor.AbstractActor;
import akka.actor.Props;
import akka.event.Logging;
import akka.event.LoggingAdapter;...
0
votes
0
answers
49
views
BroadcastHub instances on Websocket connection are not cleaned up after disconnect
I have a web applications that is only available on an intranet.
It serves data to the frontend asynchronously via Websocket.
However, running it for a while will create multiple instances of ...
2
votes
0
answers
43
views
Alpakka search in elasticsearch without scrolling
can someone help me how can I search without using the scroll feature inside the elastic with alpakka.
I want to use alpakka or akka-stream to reactively send a query to elastic without scrolling, But ...
0
votes
1
answer
65
views
Code not working for FileTailSource in akka Stream
I have a log file that is fed data about every visit for some websites ( it is actually just a python programm that simaulates this ) , i want to count the number of visits per websites .
So i m ...
0
votes
1
answer
39
views
Single task typed actors
I often use actors that perform a single computationally expensive task. After
completing its task this type of actors sends the result to its creator und
terminates itself afterwards.
Im am not quit ...
0
votes
1
answer
36
views
Akka service should be reported as unhealthy if it is unable to connect to a Kafka cluster or database
By default all readiness checks are hosted on /ready and liveness checks are hosted on /alive.
If akka service is unable to connect to Kafka cluster, then the service should report as unhealthy.
What ...
0
votes
0
answers
54
views
How can get the count of Active live actors?
I'm using akka cluster sharding 2.5.23. For my case i want to know the current live active actors count.I have read many articles saying use Lightbend telemetry which is paid.And Cinnamonor or kamon ...
0
votes
1
answer
96
views
an openapi client jar, generated for scala-akka by openapi-generator-maven-plugin, causes canBuildFromIterableViewMapLike() not found, under Zeppelin
I'm generating a Scala client jar with org.openapitools:openapi-generator-maven-plugin so that my Zeppelin will be able to execute this sample of code,
openapi-generator-maven-plugin offers few ...
0
votes
1
answer
43
views
Akka stream fails when throttled
I'm using Akka Streams to stream lines of text from a file. All I'm trying to do currently is print each line to stdout. I'm able to get this working without any throttling, i.e. all the lines print ...
0
votes
1
answer
24
views
Initialise Akka ActorRef with the same state as previous one
How do I share the state of balance between AkkaActors?
I understand how to initlise an Actor using props but whenever I create that Actor it'll new up a new Actor with the same values. Can I use the ...
0
votes
0
answers
21
views
How to provide a DER server certificate file to Akka HTTP
I am trying to provide a server certificate file to my Akka HTTP application using the following code.
import java.io.{BufferedInputStream, IOException}
import java.security.{KeyStore, SecureRandom}
...
0
votes
0
answers
43
views
Akka gRPC authorization rejection causes "12 INTERNAL" error
As mentioned on Akka gRPC documentation (https://doc.akka.io/docs/akka-grpc/current/server/akka-http.html) we can interop with Akka Http.
According to sample, request can be rejected (if check fails). ...
0
votes
1
answer
97
views
Akka Stream application using more memory than the jvm's heap
Summary:
I have a Java application that uses akka streams that's using more memory than I have specified the jvm to use. The below values are what I have set through the JAVA_OPTS.
maximum heap size (...
0
votes
1
answer
56
views
Uri.Path is not parsing / in scala
I have a filePath which I am trying to extract from a String. The string looks like:
val myPath: String = "InitialIndexValue/this/is/some/kind/of/path"
val firstIndex = myPath.indexOd('/')
...
0
votes
0
answers
74
views
Akka Kubernetes API is not able to access Service account token
We are working with Akka Kubernetes API to connect to other pods in the Kubernetes cluster(AWS EKS) to form a cluster. But we are getting the following error when the token is being read
[ERROR] 2022-...
0
votes
1
answer
32
views
Akka Cluster: Down all when unstable & SBR's role
I have a lot of worker nodes in my akka-cluster, which cause Down all when unstable decision due to their instability; But they don't have SBR's role.
Why Down all when unstable decision in not taken ...