Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:51
    akka-ci commented #27545
  • 08:50
    akka-ci unlabeled #27545
  • 08:50
    akka-ci labeled #27545
  • 08:29
    akka-ci commented #27499
  • 08:29
    akka-ci unlabeled #27499
  • 08:29
    akka-ci labeled #27499
  • 08:22
    akka-ci commented #27491
  • 08:22
    akka-ci unlabeled #27491
  • 08:22
    akka-ci labeled #27491
  • 08:21
    akka-ci unlabeled #27499
  • 08:21
    akka-ci labeled #27499
  • 08:19
    johanandren synchronize #27499
  • 08:19
    akka-ci commented #27538
  • 08:19
    akka-ci unlabeled #27538
  • 08:19
    akka-ci labeled #27538
  • 08:15
    akka-ci unlabeled #27491
  • 08:15
    akka-ci labeled #27491
  • 08:11
    akka-ci unlabeled #27538
  • 08:11
    akka-ci labeled #27538
  • 08:10
    johanandren ready_for_review #27538
brabo-hi
@brabo-hi
Hi. I have a cluster with two nodes. NodeA uses a servicekey to register an actor to receptionist. NodeB subscribe to receptionist using another instance of the servicekey. On NodeB, i am receiving a listing but with an empty set? What could go wrong ?
Arnout Engelen
@raboof
@volgad I'd start out without any explicit .async - I think it's pretty rare that you need to add those explicitly
Arnout Engelen
@raboof
@oen9 I'm not too familiar with cats, but could genRand[IO].unsafeToFuture().pipeTo(sender()) make sense?
oen9
@oen9
@raboof Right it's even better but I think inside pipe I still should use savedSender instead of sender(). Anyway this is just dummy code and my question is more about handling effects: should I use unsafeRunSync() or unsafeToFuture() or is there any better solution? I have library I need to work with and I don't know what are 'best practices' to connect cats-effect with akka actors. With heavy blocking operations solution inside Bar class is desirable but is it acceptable to use unsafeRunSync() with some light computations?
Behroz Sikander
@bsikander
Hi, is it possible in Spray/Akka-Http to have both HTTP/HTTPS enabled at the same time e.g. on custom port 8090? My problem is that I want to migrate to HTTPS but during and after (for a short period) migration, I want to support both protocols so that clients have some time to update.
Gervais Blaise
@gervaisb

Hello there, I have an idea that I would like to validate with Akka pros.
We have an existing system that manages (let's say) clients and invoices. And we have to integrate that system with other applications. We don't want to pollute our code base with this integration so we have another module that talk with the existing system trough his REST Api (..).
The integration is mainly to:

  1. execute many commands in one call (CreateInvoice -> CreateClient + CreateInvoice).
  2. map our identifiers with the external ones.
  3. translate the domain concepts (Customer = Client + Invoices).

My idea is to create some actors that represents the main concepts, dispatch and coordinate the Http calls to the API to realize the command. (AddCustomer will be GET||POST /clients and one or many POST /invoices).
The thing is that "GET||POST /clients". If a client exist I should create an actor for it and load his state, otherwise I should create a new actor and populate his state. But I cannot have persistent actors in the integration module. I am thinking to use actorSelection() with a fallback to a new actor. Then, for each case, send an "Init" command that is filled from the API result for an existing one or from the incoming command for a new client.
So basically the flow will be:

  1. HTTP: POST /integration/invoices {clientId, clientName, invoices[]}
  2. Controller: InvoiceService.getOrCreateClient(clientId, clientName)
    2.1. InvoiceService: actorSecelection(clientId).map(_ ! Init(..)).recover( actorOf(..) ! Init(..) )
  3. Controller: invoices.foreach( clientActor ! AddInvoice(..) )
    3.1. ClienActor: WsClient.get("legacy-api/some-check")
    3.2.a. ClientActor: on 3.1. match Success => WsClient.post("legacy-api/invoices")
    3.2.b. ClientActor: on 3.1. match Failure => WsClient.post("legacy-api/other-resource")

Does that looks very weird or is it a viable approach ?
Thanks

michalbogacz
@michalbogacz
Hi, I have small question about Scala 2.11 and java API: how to fix "missing parameter type". Compilation on Scala 2.11 is failing on map and I can't find the right syntax. More info https://travis-ci.com/akka/alpakka/jobs/226125470#L850
tayvs
@tayvs

How can I set positive-ttl in AsyncDnsResolver like in InetAddressDnsResolver?
I've faced with issue when a dns-server response contains ttl, for instance, a 1 day, but ip of the target service could be changed in any time.
InetAddressDnsResolver refreshes cache and sends requests to the dns-server according to the positive-ttl or negative-ttl settings. But AsyncDnsResolverdon't send any request until cache record expired, in my case, it's a 1 day. I've tried InetAddressDnsResolver with DnsServiceDiscovery but DnsServiceDiscovery uses DnsProtocol.Resolve and InetAddressDnsResolver can process only Dns.Resolve.
Is there a way to deal with this issue?

Can anyone help with this?

Igmar Palsenberg
@igmar
Fix your DNS ?
Kobulyanskiy Roman
@burbaki
@igmar No I didn't. But , I've tried to create a my own implementation of DnsResolverwith DnsProvider which will be able to handle DnsProtocol.Resolveand positive-ttlin the same time . Unfortunately, most of all components, like DnsClient, belong to InternalApi, and I have to implement this components by myself.
Igmar Palsenberg
@igmar
That will most likely not help : the resolver you talk to will most likely also cache.
Patrik Nordwall
@patriknw
Akka 2.5.25 released. Important fix to Cluster Singleton. https://akka.io/blog/news/2019/08/20/akka-2.5.25-released
volgad
@volgad
@raboof Hi, Thank you for the repply. Yes it's what I started with. Then I added async in a few places where I thought there was a clear cut in computations of the stream but didnt notice any change / improvement in run time, thread and memory usage. Is the graph materialization actually handlung all that stuff? Is it better to use mapAsync and use Future inside calls when possible or it will boil down to the same thing? Thanks
On a separate note, I am currently exploring switching to graal VM (initially CE and then potentially EE ) to run an akka stream application. I tried J9 and Zulu but didn't really see massive improvements or changes. Does anybody have any advice / comment on using alternative JVM to run akka and can share best practive or feedback? Thank you
Sven Ludwig
@sourcekick
@volgad Some of your questions might be answered by this: https://blog.colinbreck.com/maximizing-throughput-for-akka-streams/

@volgad Also definitely read https://doc.akka.io/docs/akka/current/stream/stream-rate.html and https://doc.akka.io/docs/akka/current/stream/stream-parallelism.html

After all this you can also consider and try to increase the input buffer sizes for Akka Streams stages, see https://doc.akka.io/docs/akka/current/stream/stream-rate.html#internal-buffers-and-their-effect (part of the second link above).

Before these things have been considered and covered, I would not switch the VM or some other more underlying stuff in the stack.
volgad
@volgad
@sourcekick thanks
Sean Kwak
@cosmir17

I am implenting a 'message queue like system' using Akka actor router. https://doc.akka.io/docs/akka/current/routing.html
I want a routing policy that sends only one message to a idle child actor. (If it's already processing a message, then I would like to send a message to a different child actor. If all the children actors are busy, then the router stashes messages until a child actor is available)

Is there a routing policy for such need? Thank you :)

Tim Moore
@TimMoore

@cosmir17 there's no way for the router to know what the children are doing, but you might want to look at the work pulling pattern where children request the next message when they're idle: https://www.michaelpollmeier.com/akka-work-pulling-pattern

You might also be able to solve your problems using Akka Streams.

Sean Kwak
@cosmir17
@TimMoore Thank you for the wonderful link & the tip. I was thinking about Akka stream too but my Akka stream knowledge is too shallow. Does Akka stream have a Queue API so that I can store tasks? Can Stream be a mutable queue?
Igmar Palsenberg
@igmar
Can I somehow make TestProbe.childActorOf create actors under /user/ instead of /system/ ?
Tim Moore
@TimMoore
@cosmir17 there is a queue source https://doc.akka.io/docs/akka/current/stream/operators/Source/queue.html but depending on what the ultimate source of the data is, there might be a better option
Sean Kwak
@cosmir17
@TimMoore These are gems. Thank you, Tim 👍 I am proud to be a person having a journey in Akka world.
treefolk
@treefolk
Guys, how to debug or print response in check() method of akka-http-testkit?
println(responseAs[String]) does not work for me
Sean Kwak
@cosmir17
@treefolk can we have an example, please?

Hi, I have a question.

I have an Akka class

class GenericActorClass(headphone: String) extends Actor {
....
}
val actorRef = system.actorOf(props.....)

how do I get a value of 'headphone' variable from actorRef?

Thank you,
Sean

Igmar Palsenberg
@igmar
@cosmir17 Not from the actorref. If you want the value, you need to send a request + response.
Sean Kwak
@cosmir17
@igmar Oh, I see. thank you for your kind response. when you said, "request" and "response", it's Ask(?), right?
Igmar Palsenberg
@igmar
Yes
Sean Kwak
@cosmir17
@igmar I see. Thank you 👍❤️
jacobg
@jacobg
If sending SIGTERM to a process, does Akka HTTP server and streams automatically terminate? Or is it necessary to explicitly add CoordinatedShutdown tasks for them? Is there anything else that the application developer needs to do, or will Akka by default shut everything down within a reasonable amount of time?
Sean Kwak
@cosmir17

Hi, I am making http-requests(async-http-client) with different paths inside my Actor class.

def recieve: Receive = {
case .... =>
val sdr = sender()
httpClient.get(path).params(paramMap).execute().pipeTo(self)(sdr)
}

This returns a RichResponse, I can pattern matching inside recieve method. I can get the full path of the URL from RichResponse. Or if it doesn't, I can map Future and include path as a tuple.

when a request times out, it becomes an issue because I can't know which request times out (different paths) and there seems no way to pass the full path URL.

    case r@ Status.Failure(_: TimeoutException) =>

the timeout exception only shows 'www.domain.com', it doesn't show a full path.

Is there a way to pass 'a full url path' inside Akka.Status.Failure?

Arne Claassen
@sdether
I'm trying to check my assumptions on backpressure.. I'm using ActorSink.actorRefWithAck with an SqsSource and I thought that it would only deliver me message for every Ack I send back
What I seem to be observing, however is that up until i stop sending acks back, messages come in instantaneously, but then i still get a message every 5 seconds.
Perfectly likely that I have something wrong with my code, but wanted to make sure I at least understand how backpressure should be working
Arne Claassen
@sdether
Nothing like typing your questions into a public forum to solve the issue. :( Of course, I found the bug that's still sending acks in code I was sure was not getting executed. All is well with backpressure
Tim Moore
@TimMoore

@jacobg by default, Akka will trigger CoordinatedShutdown in the JVM shutdown hook, which will be run when it gets SIGTERM. This can be disabled with the akka.coordinated-shutdown.run-by-jvm-shutdown-hook=off config setting. See https://doc.akka.io/docs/akka/current/actors.html#coordinated-shutdown for details.

However, Akka HTTP does not register a CoordinatedShutdown task by default, so you should do that yourself. See akka/akka-http#1210 for discussion.

gtlink
@gtlink
Hello
i am trying to build a point of sale system and need some way to coordinate like concurrent purchases. And i am wondering how i might go about doing that using Akka's actor model...
gtlink
@gtlink
anyone there?
Gervais Blaise
@gervaisb
Hello, I would like to setup my actor state according a WS call, is it better to call the WS from the preStart, and send an init message with the fetched values or is it better to send an init message that will fetch the values ?
The thing is that the WS may reply a 404 in which case I should send another request to save teh values on the WS.
Zach Banducci
@zchbndcc9
Is it possible to use AkkaManagement with a typed ActorSystem? Or do I have to convert my ActorSystem to untyped?
sinanspd
@sinanspd
this has been answered here (https://stackoverflow.com/questions/23805727/how-to-terminate-a-hung-akka-actor) but I am asking in case something changed in the past 5 years. If there a way to restart a hung actor from the parent/supervisor ?
Anirudh Ramesh
@anirudhr95
Hey guys, slightly off topic but I'm hoping you guys can help me with this - suppose I want to write my own JMS client (Not implement the interface) but the underlying client itself (like Websphere MQ or RabbitMQ but compliant with JMS), what would be a good place to start?
You can call it an assignment, but this requires that I use no third party service and that I write this on my own.
T_T
Thai Dang Vu
@dxxvi
Hi Al, does akka http client support keep-alive? If yes, how to specify it? I cannot find it anywhere in https://doc.akka.io/docs/akka-http/current/introduction.html. It mentioned keep-alive for websocket only.