Questions tagged [akka-actor]
134 questions
11
votes
1 answer
Is an ActorRef updated when the associated Actor is restarted by the supervisor?
If I create an logging actor like so
val logger: ActorRef =
actorSystem.actorOf(Props(new Logger()))
and the logger restarts due to an Exception, my logger stops writing to disk.
I had been sending messages logger ! msg
Am I correct in assuming…

kliew
- 3,073
- 1
- 14
- 25
8
votes
2 answers
How to use akka in Scala 3?
How to use akka in Scala 3 ? I can't find akka dependencies while using scala 3
sbt errors :
[error] not found: /Users/admin/.ivy2/localcom.typesafe.akka/akka-actor-typed_3/2.6.15/ivys/ivy.xml
[error] not found:…

Ji Shuai
- 101
- 1
- 2
6
votes
1 answer
How to meaningful document an actor design
I'm pretty new to akka/actor systems and try to understand code which a colleague has written.
Doing this, I ask myself what kind of documentation would be helpful to get a faster understanding of the implemented "actor system".
As far as i…

Hansjoerg Wingeier
- 4,274
- 4
- 17
- 25
5
votes
1 answer
this vs self inside akka actor class
Let's say I have a very simple actor class which receives any message and prints to the console.
class SimpleActor extends Actor{
def receive: Receive = {
case message =>
println(s"[${this}][${self}] received message:…

Manoj Sehrawat
- 1,283
- 1
- 10
- 25
4
votes
1 answer
Find actor by persistence id
I have a system, that has an actor per user. Users send messages rarely, but when they do, they send usually not only one, but few.
Currently, I have a map, where I store persistenceId -> ActorRef. When I'm receiving a new message for an actor, I…

psisoyev
- 2,118
- 1
- 25
- 35
4
votes
1 answer
Custom SupervisorStrategy for Akka System Guardian
According to the Akka docs on the System Guardian, if a top-level actor throws an Exception, it will be restarted indefinitely (with 2 exceptions - no pun intended).
My actor system has 1 and only 1 top-level actor: Initializer. If Initializer…

smeeb
- 27,777
- 57
- 250
- 447
3
votes
0 answers
Is there a way to use Akka Stash over Priority Mailbox?
In an Akka Actor application, I have to postpone receiving certain types of messages after receiving a Control Message. For the sake of control messages, I had to implement my own priority Mailbox that prioritizes Control messages over ordinary…

13leak
- 73
- 9
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
3 answers
Akka Actors: ask pattern vs Promise
Lately I've found myself wrapping actors in classes so that I get back a little of the typesafety I lose when dealing with ActorRefs.
The problem is, at the end, that not only I need to send a specific message, I also need to cast the response to…

caeus
- 3,084
- 1
- 22
- 36
3
votes
0 answers
Integrating streaming events from eventstore with akka actors using akka streams in Java
I am working with GetEventStore as the journal provider for the events persisted by akka-persistence and accessing the akka.persistence.query.javadsl to query the events from eventstore. The actor system and the journal provider is configured using…

smartinsert
- 89
- 8
3
votes
2 answers
mapMaterializedValue doing nothing with Source.actorRef
I am trying to send message to actor bindet with Source.actorRef, but this part of code:
println(s"Before mapping $src")
src.mapMaterializedValue { ref =>
println(s"Mapping $ref")
ref ! letter.text
}
println(s"After mapping $src")
is printing…

Sasha
- 105
- 9
3
votes
3 answers
How to get load file under resources folder in scala sbt
I am having a akka actors config file under resources,
src/main/resources/remote_app.conf
src/main/scala/actors/Notification.scala
I am loading the resources as below,
1.
val configFile =…

PGS
- 1,046
- 2
- 17
- 38
2
votes
1 answer
Build and Run Akka with Scala 3+
I'm trying to build and run a project using Akka and Scala 3+ but I encounter a lot of errors.
My build.sbt looks like
name := "akka"
version := "0.1"
scalaVersion := "3.1.1-RC1"
//…

user3476509
- 171
- 10
2
votes
0 answers
play framework ActorFlow with backpressure
Current play framework implementation for flow implementation for an actor class is written without back-pressure. I would like to implement with back-pressure replacing actorRef with actorRefWithAck. But the actor flow is written in Scala, which…

sasankad
- 3,543
- 3
- 24
- 31
2
votes
1 answer
Get the chosen actor in a RoundRobinPool?
If I had a RoundRobinPool like this
val actorPoolRef = AkkaConfig.actorSystem.actorOf(RoundRobinPool(100).props(Props[MyService]))
and a handler
def requestHandler(request: HttpRequest): Future[HttpResponse] = {
val promise =…

edg
- 21
- 2