Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 26 2020 07:39
    patriknw labeled #29767
  • Oct 26 2020 07:39
    patriknw labeled #29767
  • Oct 26 2020 07:39
    patriknw labeled #29767
  • Oct 26 2020 07:39
    patriknw labeled #29767
  • Oct 26 2020 07:38
    patriknw commented #29767
  • Oct 26 2020 07:07
    patriknw commented #29765
  • Oct 26 2020 06:56
    patriknw commented #25468
  • Oct 26 2020 06:30
    wtfiwtz starred akka/akka
  • Oct 26 2020 04:31
    YunSeongKim7 starred akka/akka
  • Oct 25 2020 16:21
    nitikagarw commented #25468
  • Oct 25 2020 09:22
    fubiao starred akka/akka
  • Oct 25 2020 05:09
    saguywalker starred akka/akka
  • Oct 24 2020 21:47
    tt4n starred akka/akka
  • Oct 24 2020 21:20
    akka-ci commented #29672
  • Oct 24 2020 21:05
    dope9967 commented #29672
  • Oct 24 2020 21:03
    akka-ci commented #29672
  • Oct 24 2020 21:03
    akka-ci unlabeled #29672
  • Oct 24 2020 21:03
    akka-ci labeled #29672
  • Oct 24 2020 20:44
    dope9967 synchronize #29672
  • Oct 24 2020 20:31
    akka-ci unlabeled #29672
Andrey Ladniy
@AndreyLadniy

I need unusual akka-persistence behavior.

I want to use the database as the state of the persistent actor. The state of this object can be infinitely large, it is possible that it may not fit in memory, and to make a decision, you only need an object from this state and it is important to maintain the chronological order of creating and changing these objects (therefore, it is impossible to put them in separate actors).

Therefore, I came up with the idea to create a state table in the database, update it after writing the event in the 'thenRun' method, in case of failure to update this table, stop the actor. In the process of restoring the author's state based on the number of the last used message number in the table update process, also perform an update if there were messages, but there was no updates.

I think with this usage scheme, the database will have exactly the same state as in the case of the classic state in memory

To check commands, use query to this table.

Is it possible to use the persistent actor in this way?

7 replies
Andrey Ladniy
@AndreyLadniy
In fact, I have a simple task. There is a command "push object Y after object X". And if there is such "object X", the event "object Y pushed" is persisted (so ever after "object Z" can be pushed after "object Y" ). So it is important to maintain the chronological order of events, but the number of objects can be very large.
wale sho
@walesho_gitlab
Hello all,
Are there any guides on how to scale Akka Http?
Does Akka Http get scaled by using an Akka cluster?
Thanks
Sven Ludwig
@iosven
@walesho_gitlab If you have a stateless service that maybe talks to a database and/or produces to Kafka, you do not need Akka Cluster. Just farm nodes of your service, i.e. just increase the node count for that service in your favorite container orchestration tool from 1 to n with n == whatever you need. And make sure you have respective load balancing in place (via nginx, Traefik, whatever solution you employ), so that http requests are distributed across the nodes.
@walesho_gitlab Akka Cluster you could for example use if you have a stateful service so that you can make use of Akka Cluster Sharding or CRDTs (see https://doc.akka.io/docs/akka/current/typed/choosing-cluster.html and https://doc.akka.io/docs/akka/current/typed/cluster-sharding.html and https://doc.akka.io/docs/akka/current/typed/distributed-data.html etc.)
wale sho
@walesho_gitlab
@iosven thanks for your insight. :-)
Nimrod Sadeh
@nsadeh
For ActorSource.actorRef[T], does the partial function argument for completionMatcher need to do anything or does any message to the actor that matches the function complete the stream? I am unable to complete a stream created this way, even though I know the message matches from print statements
7 replies
benoitmartin
@benoitmartin:matrix.org
[m]
Hi everyone,
I'm currently playing around with the idea of spawning an actor on a remote node. I'm trying to achieve this by using the SpawnProtocol. However, I'm faced with a "Failed to serialize message [akka.actor.typed.SpawnProtocol$Spawn]" error.
My guess is that the embedded behavior must be serialized and that this is not possible by default. Here is my question: is it possible to serialize a behavior ? 🙂
Thanks to anyone that can help !
6 replies
CorruptOffset
@CorruptOffset
Hi. I was asking myself what the best practice is when to do a scatter/gather of messages to all members of the cluster. I saw there is the possiblity with DistributedPubSub. But Thats only one way correct?
In my application I have a Master Singleton and X Worker Nodes. How can I effciently share a message from master to all workers and wait for all responses?
1 reply
Jan Ypma
@jypma

What's the quickest way to configure a TLS client certificate for akka http client? The docs seem rather light, and just doing

   akka.ssl-config {
     keyManager = {
       stores = [
         {type = "pkcs12", path = "cert_key.p12" },
       ]
     }
   }

doesn't seem to be enough.... the config is picked up, but no client certificate is sent (No X.509 certificate for client authentication).

Odd Möller
@odd
@jypma Which version of Akka HTTP are you using, the way to set up TLS seems to have changed in Akka HTTP >= 10.2, instead of using https://lightbend.github.io/ssl-config/ for configuration, the documentation for the current version shows how to configure it using regular Java APIs (compare https://doc.akka.io/docs/akka-http/10.1.2/server-side/server-https-support.html with https://doc.akka.io/docs/akka-http/current/server-side/server-https-support.html )
Jan Ypma
@jypma
Hmm I seem to be on 10.1.11 somehow :) I'll see if upgrading makes things easier then. Thanks!
Either way, this is for client-side TLS certificate, not checking them server-side.
Jan Ypma
@jypma

Still no cigar after upgrading to 10.2.4, now passing JVM arguments (through bloop)

 -J-Djavax.net.ssl.keyStoreType=pkcs12 -J-Djavax.net.ssl.keyStore=cert_key.p12 -J-Djavax.net.ssl.keyStorePassword=

The keystore is read, since I get an error when I change the file name. But it's not selected.

Pablo Gamaleri
@pablo.gamaleri_gitlab

Hi everyone!
I'm using a KinesisFlow from alpakka-kinesis to write to an AWS Kinesis Data Stream, and I believe to be losing data when doing so.
The problem happens when I send a PutRecordsRequestEntry message to this flow, its output can be a failed PutRecordsResultEntry (even though the PutRecords request is successful) which I’m not being able to match back with its corresponding PutRecordsRequestEntry in order to retry it (see https://docs.aws.amazon.com/streams/latest/dev/developing-producers-with-sdk.html).

val clientFlow:  Flow[PutRecordsRequestEntry, PutRecordsResultEntry, NotUsed] =
    KinesisFlow(streamName.value, flowSettings)(kinesisClient)
    .map { entryResult: PutRecordsResultEntry =>
        if (entryResult.errorCode ne null) { /* need to feed its input back into the stream */ }
        entryResult
    }
    .recover {
        case FailurePublishingRecords(e) => /* ... */
        case e: Throwable => /* ... */
    }
val sink: Sink[PutRecordsRequestEntry, NotUsed] = clientFlow.to(Sink.ignore)
val streamActor: ActorRef = Source.actorRef(1000, OverflowStrategy.fail)
    .toMat(sink)(Keep.left)
    .run()

Is this already being handled somewhere for these cases of partially successful PutRecords?
Thanks in advance!

Anirudh Vyas
@AnirudhVyas
hi there, I am attempting to use Akka Http Route testkit, and trying to use
Get("someContextRoot/entity") ~> routes ~> check { some test}
but it cannot recognize the someContextRoot for some reason
any trick to this I might be missing ?
Anirudh Vyas
@AnirudhVyas
nvm I figured it out - was missing / at the beginning - thanks anyways.
Divyanshu Srivastava
@Divyanshu564

Hello Everyone,
I am trying to upgrade my Akka cluster from 2.6.9 to 2.6.10 but getting this particular error

https://stackoverflow.com/questions/67382925/nullpointerexception-in-shardcoordinatorleastshardallocationstrategy-when-updat

Can someone help me to understand what was missing?
nikiiv
@nikiiv
HI.. Recently we ported a huge project from using an old legacy Actor based implementation using RPC to Akka.
I noticed that heartbeatSender is running on the default-dispatcher. My understanding is that this should happen on internal-dispatcher, like ClusterReceptionist.. What is the gist on this... Shuoldn't it run on the pool reserved for Akka internals?
2 replies
Desmond Yeung
@desmondyeung
Hello everyone,
I'm handling a publisher with type org.reactivestreams.Publisher[ByteString] created from a 3rd party library and am converting it into a Source[ByteString, _] with Source.fromPublisher.
I've written a custom graph stage of type GraphStage[FlowShape[ByteString, ByteString]] that processes the Source. My question is if I need to call failStage in the graph stage partway through processing, is that a leak/does source need to be drained or does the cancellation of the input port handle that?
1 reply
nikiiv
@nikiiv
I am going to re-send my question with additional information.
HI.. Recently we ported a huge project from using an old legacy Actor based implementation using RPC to Akka. Currently this happens on 2.6.10
I noticed that heartbeatSender is running on the default-dispatcher. My understanding is that this should happen on internal-dispatcher, like ClusterReceptionist.. What is the gist on this... Shuoldn't it run on the pool reserved for Akka internals?
hygorkn
@hygorkn

Hi everyone,

I'm trying to create a stream to list all news files created in a SFTP server using Akka Streams and Alpakka SFTP.

The problem is that Alpakka SFTP only list the files once, and when I consume all of them the stream is finished. I tried wrapping the stream in a infinite loop and await for the future result but it doens't work. Also, I tried using a RestartingSource with a fixed duration but the stream only runs once.

Is there a better way to do this?

Gabriele Favaretto
@gabriele83
Hi, How can a Sharded Actor who subscribe to the DData Event Stream receive notifications if he is passivated?
it's possible?
18 replies
Leif Warner
@LeifW
Is there an "identity" directive in akka-http?
Basically I want to apply a directive or not, depending on if an Option is defined.
Ah - found Directive.Empty
Arsene Tochemey Gandote
@Tochemey
Hello akka geeks I am using the ScalatestRouteTest to unit test my akka http route. However when I run the tests I don't see my test executed in the list of tests that have run and there is no error for me to know what really happens. First I thought the test is slow so I set implicit val timeout = RouteTestTimeout(30.seconds.dilated) but in vain. Does anyone have an idea what I might be doing wrong?
raboof
@raboof:matrix.org
[m]
Ignacio
@ghoto

Hi, I'm pretty new to Akka. I'm trying to run the examples of Akka HTTP, but seems there is a big problem with the example (https://doc.akka.io/docs/akka-http/current/client-side/request-level.html#future-based-variant). The object Http requires an ActorSystembut the typed version doesn't seem to work because it's an ActorSystem[Any]. Therefore it can't find the implicit val system = ActorSystem(Behaviors.empty , "SingleRequest") and when the system is given explicitly to the Http object, it complains it's not the type expected (Errortype mismatch; found : akka.actor.typed.ActorSystem[Any] required: akka.actor.ActorSystem (Line 15,52))

I noticed that the typed.ActorSystem can convert to untyped version, but then we can't define an execution context.

I'm using akka-http_2.12:10.2.4 akka-actor-typed_2.12:2.5.26 and akka-stream_2.12:2.5.26. Wondering if this run for you all..

Ignacio
@ghoto

Hi, I'm pretty new to Akka. I'm trying to run the examples of Akka HTTP, but seems there is a big problem with the example (https://doc.akka.io/docs/akka-http/current/client-side/request-level.html#future-based-variant). The object Http requires an ActorSystembut the typed version doesn't seem to work because it's an ActorSystem[Any]. Therefore it can't find the implicit val system = ActorSystem(Behaviors.empty , "SingleRequest") and when the system is given explicitly to the Http object, it complains it's not the type expected (Errortype mismatch; found : akka.actor.typed.ActorSystem[Any] required: akka.actor.ActorSystem (Line 15,52))

I noticed that the typed.ActorSystem can convert to untyped version, but then we can't define an execution context.

I'm using akka-http_2.12:10.2.4 akka-actor-typed_2.12:2.5.26 and akka-stream_2.12:2.5.26. Wondering if this run for you all..

Regarding this. I resolved it by using Akka 2.6.14 and Akka-Http10.2.4 seems there is some incompatibility issue. Same code "same packages" just different versions.

raboof
@raboof:matrix.org
[m]
@ghoto: indeed we have improved classic/type interop on recent versions, glad that's working for you ;)
Max
@maxstreese

Hey everyone! Got a newby question I hope to get some insights into. Suppose I have an application that receives messages from a Kafka topic. It's task is to send these messages to some TCP API which has it's own logic and therefore requires some form of state machine (e.g. you need to log in first and wait for confirmation before being allowed to send messages, you need to acknowledge pings, ...). My question(s) are very broadly about the general application structure and how to combine Akka Actors with Akka Streams here:

  • Do all streams need to be started inside main and outside any actor or is it fine to have e.g. one actor be in charge of the Kafka stream and one in charge of the TCP stream such that both of those streams are started in their respective actors?
  • Do you think that a problem like this is a good fit for the combination of Akka Actors and Streams or would you approach this completely differently?

I realize that this is very broad and rather poorly outlined but any pointer at all would be a great help. Thanks!

3 replies
brabo-hi
@brabo-hi
can we hot reload akka-http project with the command sbt ~ run
raboof
@raboof:matrix.org
[m]
@brabo-hi: I don't think so, because I think ~ waits for the command to finish, and run doesn't finish. It sounds like you're looking for https://github.com/spray/sbt-revolver
brabo-hi
@brabo-hi
@raboof:matrix.org thank you for your help
Gaël Jourdan-Weil
@gaeljw
Hi folks,
I opened a question on SO about being able to "detect" a Source failure at startup => https://stackoverflow.com/questions/67467565/play-framework-akka-streams-intercept-errors-at-source-startup
I was wondering if anyone here would have any idea on the subject. Any help appreciated, thanks :)
Didac
@umbreak

Hi. I came up with the following benchmark on GRPC: https://github.com/LesnyRumcajs/grpc_bench/wiki/2021-04-13-bench-results

akka-http (using akka streams) rates very low on the benchmark. It could very well be on the nature of the benchmark (if that’s the, could someone point out what to change on the scala side to improve it). If it is not, what could be done to address the performance issues? Is that on the scalapb side, on the akka-http side or on the akka-streams side?

4 replies
bblfish
@bblfish:matrix.org
[m]

It is an antipattern to have state that crosses an actor right?
But is it really problematic to have a isStale function

class DataMessage(data: Stuct) { 
   def isStale: Boolean ...
}

where the actor that sends out the message can set its DataMessage to stale, letting any other actor on the same JVM know to fetch a new one.

1 reply
Alex Klibisz
@alexklibisz
Hi all, I have a question about the Uri model. Is there a way to add query parameters to a Uri which already has some query parameters? Calling .withQuery seems to replace the existing query parameters. So far the best I've found is to extract the original query, convert it to a Map, concatenate the Map with a Map of new params, and then pass the concatenated map to .withQuery.
2 replies
Ceyhun Can Ulker
@ciuncan
Hi,
Isn't shutdown applied to each materialized akka stream when the actor system initiates coordinated shutdown? I can see that the task I added to coordinated shutdown being executed (logs) but I don't see the logs I added to Sink.onComplete and also via .watchTermination on the stream. If I trigger a kill-switch in the coordinated shutdown task I registered, I see logs in both from Sink.onComplete and .watchTermination. So do I have to always use a kill-switch for such infinitely running streams?
2 replies
Zhenhao Li
@Zhen-hao
hi, my serializer implemented ByteBufferSerializer but Akka still uses the se/de methods with byte arrays. do I need to change anything in the config?
2 replies
Zhenhao Li
@Zhen-hao
I have Exception in thread "main" java.nio.file.AccessDeniedException. but my aeron-dir has been created and owned by my app user. what can cause this error?
Sathish
@Sathis

Hi, I Downloaded akka sample project in github for using multi-jvm.
I get the following sbt error when the project is imported. My machine is not behind proxy. Do i need to add the cert to default trustore of JVM to fix this issue?

https://github.com/akka/akka-samples/tree/2.6/akka-sample-cluster-scala

unable to find valid certification path to requested target) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-multi-jvm/scala_2.12/sbt_1.0/0.4.0/ivys/ivy.xml
unable to find valid certification path to requested target) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-multi-jvm/scala_2.12/sbt_1.0/0.4.0/ivys/ivy.xml

Jeff May
@jeffmay
is there anyway to catch the InterruptedException so that I can terminate the actor system and prevent it from running in the background of sbt? I am trying to avoid forking the JVM, but maybe that is the wrong approach?
Enno Runne
@ennru
Mr. Follower
@MrFollo49718686_twitter

hi all

spray has been replaced with akka http, but is spray json here to stay? what is its future?

Mr. Follower
@MrFollo49718686_twitter
we are using akka-http-spray-json but since it has spray in the name the question is whether this library is going to be supported