Questions tagged [akka]

1

votes
3

answer
98

Views

Deeplearning4j Sharing Computational Graph between Threads in Scala

I'm trying to do image classification. I'm using Scala, the Akka actor system, and deeplearning4j. The thing is that I have to detect always on the same spots or crop on the image. I was thinking of creating a new actor for each crop of the image, on each frame. The thing is that, from what I unders...
Tomas Piaggio
1

votes
1

answer
173

Views

How to add implicit method to string

How to write implicit method to string to log directly. Below Code works Fine : case class Worker(name: String) extends Actor with ActorLogging { override def receive: Receive = { case string: String => log.info('string received') case _ => log.info('unknown message received') } } Want...
Chandan Kumar
1

votes
0

answer
82

Views

Receiving reply from routees

I have an actor that creates a ScatterGatherFirstCompleted router and sends a message to get some data. This is just a simple example I made to try out different routers. When the reply is received, the sender of the reply is DeadLetters. I expected that the sender would be one of the actors manage...
Marin
1

votes
2

answer
56

Views

Akka: is there a Sink that never pulls?

Need a Sink that never pulls, to use in unit tests. Is there one already available or do I need to code it myself? Please note that Sink.ignore() won't help, because it ALWAYS pulls. I need a Sink that NEVER pulls.
Michael M.
1

votes
1

answer
308

Views

Is akka really a solution for a deadlock?

As Described here While locks seem to be the natural remedy to uphold encapsulation with multiple threads, in practice, they are inefficient and easily lead to deadlocks in any application of real-world scale. My question simply, is akka really a solution for a deadlock. I know as long as akka actor...
user2810472
1

votes
1

answer
426

Views

Spring boot and Akka cluster actor dependency injection not working

I am trying to use Spring boot and akka. I have two processes and communicate with akka cluster. Only process A uses spring boot. @Autowired private ActorSystem springActorSystem; @Autowired private SpringExtension springExtension; private ActorRef caActor; caActor = springActorSystem.actorOf(spring...
Chi Shin Hsu
1

votes
0

answer
293

Views

Bridging Kafka and Akka Streams

Kafka Streams are only supported on the JVM platform. So I am looking for a way to leverage Akka Streams in C# to build a Kafka consumer with the benefit from Akka Streams. The Confluent C# Kafka consumer is based on polling and event handling, e.g. using (var consumer = new Consumer(consumerConfi...
carstenj
1

votes
1

answer
146

Views

calling an akka actor from its outside is very slow

i'm new to akka. I made a ping-pong example between two actors (Ping Actor and Pong Actor) from two nodes on local machine and then test them in 2 different ways. Basically, Ping Actor will send a message is System.nanoTime() to Pong Actor. After get the message, Pong actor resend the received nano...
Tran Tien Duc
1

votes
1

answer
285

Views

How to create an Akka flow with backpressure and Control

I need to create a function with the following Interface: import akka.kafka.scaladsl.Consumer.Control object ItemConversionFlow { def build(config: StreamConfig): Flow[Item, OtherItem, Control] = { // Implementation goes here } My problem is that I don't know how to define the flow in a way that it...
Stoecki
1

votes
0

answer
323

Views

Spark/Akka integration

I am writing a sample code to integrate Spark/Akka. I am creating an Akka actor within Spark and I am facing the below error. Code object program { def main(args: Array[String]) { val conf = new SparkConf().setMaster('local[*]').setAppName('SparkTest') val sc = new SparkContext(conf) val system = Ac...
Nats
1

votes
1

answer
463

Views

How to get the current server request timeout in Akka HTTP

Akka HTTP allows request timeouts to be set from either the global setting in application.conf or modified on a per-route basis with directives. How can we get the request timeout for the current request and route? Something like withRequestTimeout(FiniteDuration(5, TimeUnit.SECONDS)) { extractReque...
kag0
1

votes
0

answer
374

Views

java.lang.ClassNotFoundException: akka.actor.CoordinatedShutdown$Reason when upgrading from akka 2.4.9 to 2.5.9

we are trying to upgrade the akka 2.4.9 to 2.5.9 after the announcement that akka 2.4.x has reached its EOL. During the process, we encountered the below error during runtime. java.lang.ClassNotFoundException: akka.actor.CoordinatedShutdown$Reason at java.net.URLClassLoader.findClass(URLClassLoader....
Rajkumar Natarajan
1

votes
0

answer
159

Views

Scala: Receive Pipeline Pattern implementations

I'm studing a behaviour of a scala program. I'm not a scala programmer but i need to understand how it works. Anyone could give me a good explanation about Receive Pipeline Pattern. Following link https://doc.akka.io/docs/akka/2.4-M1/contrib/receive-pipeline.html i found a part of what i want to kn...
f_s
1

votes
0

answer
63

Views

Scala alpaakka s3 connect with DO Spaces multipart upload result 403

i am trying to setup akka-http file upload to Digital Ocean Spaces. And i have got problem with multipart upload. I use alpaakka to stream file directly to s3. However i get 403 error SignatureDoesNotMatch on upload. But if i try to upload same file with simple one part upload everything works fine...
Anton M.
1

votes
0

answer
104

Views

AKKA FSM in spark streaming

I have a requirement to create state machine implementation in my spark streaming application. After reading thru some posts found AKKA comes with FSM out of the box. I created a simple AKKA FSM and I am able to run it locally. I am not sure how to integrate this code into spark structured streaming...
Nats
1

votes
1

answer
219

Views

get notification if any akka actor died

does Akka have any mechanism to catch some message if any actor in context/system was crashed/disconnected etc? for example: can I write some WatchActor which will to listen trigger like Terminated? But I dont wont to register each actor through context.watch(aсtor) or somthing like this.
Alexandr
1

votes
1

answer
994

Views

Akka log-dead-letters and log-dead-letters-during-shutdown don't work

This is a simple question, but it keeps bothering me and my logs. I have a config: akka { log-dead-letters-during-shutdown = off log-dead-letters = off } My program ends with akkaSystem.terminate() I'm pretty sure that config is loaded to the system. I've tried different combinations with false or 0...
Konstantin Bodnia
1

votes
0

answer
67

Views

Cannot configure the Akka Http server when using the akka-http-spring-boot library

I am trying to setup a project that runs REST services on top of a AKKA HTTP server yet managed by Spring boot. Now i found this project on gihub as a reference and am using that as libraries to achieve my goal. This is the project : https://github.com/scalaspring/akka-http-spring-boot Now i cannot...
Som Bhattacharyya
1

votes
2

answer
178

Views

Akka Streams GraphStage

Using GraphStage is recommended in Akka Streams, but I could not find any documentation on using the getStageActor() method in Java (all of the documentation that I have found used Scala). How can I convert the following code to Java? lazy val self: StageActor = getStageActor(onMessage) and private...
Ali
1

votes
0

answer
119

Views

how can i write the test cases for file Uploading through extractRequestContext in akka http services

Pls suggest here I have an upload service in Akka HTTP micro service it's working fine. now I need to write the test cases for below code path( 'file-upload') { extractClientIP { ip => optionalHeaderValueByName(Constants.AUTH) { auth => (post & extractRequestContext) { request => extractRequ...
Sekhar
1

votes
1

answer
244

Views

Akka Websocket Client to Kafka Producer

I am connecting to a websocket(stock market) and getting trades from it in the Sink and I want to publish those trades to Kafka. I am able to send some test messages(String) to Kafka but unable to connect the actual trades to the Kafka Publisher Here I have actorsystem, actor materializer, system di...
imran
1

votes
1

answer
352

Views

unable to connect to tcp port running in docker

I have written a mqqt broker using sbt and Akka. I run fine on my local machine but I am unable to connect to the broker when I run my code in the docker container.I see broker is running fine on port 1883. Docker logs:- [DEBUG] [02/17/2018 04:24:29.682] [run-main-0] [EventStream(akka://TcpServer)...
abhishek_rathaur
1

votes
1

answer
107

Views

Combining arbitrary number of sources with materialized values

Given xs: Seq[Source[A, Mat]] and a function to combine individual materializers into a single one, is it possible to merge xs into a single aggregate source which materializes into an aggregate Mat? Consider this practical example: Having N Kafka topics represented by N Sources of type Source[A, Co...
tkroman
1

votes
0

answer
276

Views

akka stream kafka web socket clients stop receiving messages after 30 seconds of inactive period

I want to read messages from a Kafka topic and send to web socket clients. I created a sample web socket server app using akka-stream-kafka. I am using kafka-console-producer script to send messages to kafka topic. Works fine, browser clients receive data from kafka topic over web socket. If I do no...
Vms
1

votes
0

answer
256

Views

Akka-Stream: How to handle stream exception gracefully

I am working with streaming application where I received following exceptions: ParsingException FramingException StreamTcpException I have written Supervision.Decider but it doesn't catch all types of exception. My questions are: Why Supervision.Decider doesn't catch exception, it catches high level...
Nikhil
1

votes
0

answer
131

Views

Akka stream throws ParsingException when start decompressing .gz file from middle offset

I am reading .gz file from AWS S3 bucket using Akka streaming, The application reads chunk of data and process it. The following code is working fine when I read file from beginning but if I start file from particular offset then Decompression fails and throws ParsingException. Code: object StreamA...
Nikhil
1

votes
1

answer
79

Views

How does one provide an unmarshaller for a Scala trait in Akka HTTP?

I am using Akka HTTP and spray-json. I have the following model hierarchy defined: trait Animal { def weight: Int def name: String } case class Dog( weight: Int, name: String //other specific attributes ) extends Animal case class Cat( weight: Int, name: String //other specific attributes ) extends...
oblivion
1

votes
0

answer
47

Views

Akka on a web server

If I make an application using Akka actors, Akka takes care of the underlying threads. However, if I deploy this application to a web server like WebSphere, would it cause any issues, since the web server has its own thread safety mechanisms?
Mandroid
1

votes
0

answer
337

Views

Akka HTTP: the requested resource could not be found

I'm using the Akka HTTP 'Minimal Example' for my first steps in Akka HTTP. private Route createRoute() { return route( path('hello', () -> get(() -> complete('Say hello to akka-http')))); } Now I want to add a route to my resources/web/test.html, similar to an example on the 'Directives' page: priva...
Thane
1

votes
0

answer
153

Views

Akka-SSE (deprecated Ok.feed)

I have been working with Akka SSE and found this wonderful easy understanding of SSE using javascript in the client side. http://runkalrun.blogspot.in/2016/01/server-sent-events-sse-using-scala-akka.html The only problem is, the Ok.feed() method has been deprecated in play 2.6, though we can use Ok....
Sushant Adhikari
1

votes
0

answer
70

Views

Cake Pattern & Akka = Serialization issues?

Problem: I have used the cake pattern to build a system of components (traits) which define a family of types and specialise them covariantly (cf., family polymorphism). Then I have defined a component which defines some actors and messages to be exchanged among these actors. trait BasicTypes { type...
metaphori
1

votes
1

answer
152

Views

How to initialize a FSM actor in Java?

I have teh follwoung state machine package examples; import akka.actor.*; public class ActorOnFsm { public static enum State { FirstState, SecondState, ThirdState, FourthState } public static final class ServiceData { } public class ActorFSM extends AbstractFSM { { startWith(FirstState, new Servic...
user_mda
1

votes
1

answer
52

Views

What version of scalatest to use with Akka 2.5.11?

I am trying to write a test following this documentation: https://doc.akka.io/docs/akka/current/fsm.html#overview This looks like to extend the AbstractJavaTest I need the scalatest dependency so I added the following to my pom: org.scalatest scalatest 1.2 test From more googling I found that this c...
user_mda
1

votes
0

answer
328

Views

Akka streams Source.actorRef vs Source.queue vs buffer, which one to use?

I am using akka-streams-kafka to created a stream consumer from a kafka topic. Using broadcast to serve events from kafka topic to web socket clients. I have found following three approaches to create a stream Source. Question: My goal is to serve hundreds/thousands of websocket clients (some of w...
Vms
1

votes
0

answer
45

Views

Set Akka Dispatcher AND HtttpContext for a CompletionStage

Using Play! with CompletionStages, you can supply the an HTTP context like this: CompletableFuture.supplyAsync(() -> { doSomething(); } , context); Since Play! is based on Akka, you can supply an Akka Dispatcher the same way: return CompletableFuture.supplyAsync(() -> { doSomething(); } , context);...
AHH
1

votes
1

answer
141

Views

Akka Streams: Calling push(_,_) not within onPull(_,_) is blocking the stream - Why?

I'm having trouble understanding the behaviour of a small sample customer Akka Streams Source. The idea behind the sample is that the Source should ask an Actor for the next element. See the code below class ActorSource[T](context: ActorRefFactory, actor: ActorRef) extends GraphStage[SourceShape[T]]...
cokeSchlumpf
1

votes
1

answer
129

Views

Test a connection failure during a route test using ScalaTest and Akka HTTP?

I have a route that takes an id, looks for that id in the database, and then updates the row if the id exists: pathPrefix('rules') { path(JavaUUID) { inputId => put { onComplete(Database.findById(inputId)) { case Success(Some(row)) => complete { Database.update(row.copy(test = true)) .map { _ => Sta...
Donal Tuohy
1

votes
0

answer
83

Views

Akka actor survive restarts?

I have an issue with akka AbstractPersistentFSM in surviving after restart, if I try to access the already existing actor instance after restart, I get error. I want to configure the actor to survive restart. please share with me any java samples that can continue working after restarts. Complete ex...
Ihab Yousif
1

votes
1

answer
35

Views

Invalidate Certain Messages in Akka Mailbox

We have a cluster of worker actors controlled by a supervisor. Each actor is performing a semi-long-running (300ms - 1s) task on text documents the user may be editing at the time of the processing. Whenever a user edits a file, we send a new task to this cluster to process the data and return a res...
centree
1

votes
0

answer
92

Views

How to use Source.queue with Alpakka

I'm trying to create a producer to a JMS queue that can be used more than once; i.e., I don't want to create a connection to the queue every time I send a message. I want an actor with a connection open, and each time a message comes in, it uses that same flow. Actor init Sink jmsSink = JmsProducer...
Kingpin2k

View additional questions