Re: [akka-user] Akka HTTP client - Advice for executor context

2017-04-25 Thread Konrad Malawski
Dispatcher (executor) is mostly important if you're doing bad things on it - like blocking on responses for example. If you're handling things in async / reactive ways the default akka dispatcher is fine most of the time, just don't block on it (read this: http://doc.akka.io/docs/akka-http/10.0.5/s

[akka-user] Akka HTTP client - Advice for executor context

2017-04-25 Thread Albert Gorski
Hi, I've Akka HTTP service which calls 5 other services using Akka HTTP client (Host-Level Client-Side API). Currently I have executor context per service (host/port). What is the best practice for setting executor context? I mean, should I use fork-join or cached or fixed thread pool or maybe

Re: [akka-user] At-least-once delivery with one off payload

2017-04-25 Thread Edouard Kaiser
Thanks for pointing out that feature, I totally missed it. That's awesome. On Monday, April 24, 2017 at 8:17:37 PM UTC+10, Arnout Engelen wrote: > > Might > http://doc.akka.io/docs/akka/current/scala/cluster-sharding.html#Remembering_Entities > > help? > > > Arnout > > On Mon, Apr 24, 2017 at

Re: [akka-user] Handling spray.json.DeserializationException in akka-http route

2017-04-25 Thread Alan Burlison
On 25/04/2017 19:16, Andras Szerdahelyi wrote: This looks excessively complex, given how the existing exception handling should ( in my opinion ) take care of this. I already had the customised JSON error response mechanism in place so the only new bit was converting the Spray exceptions into

Re: [akka-user] Handling spray.json.DeserializationException in akka-http route

2017-04-25 Thread Andras Szerdahelyi
OK, it is very much expected behavior per MarshallingDirectives.entity Sorry about the noise :-) On Tue, 25 Apr 2017 at 11:16 Andras Szerdahelyi < andras.szerdahe...@gmail.com> wrote: > Alan, thanks. > > This looks excessively complex, given how the existing exception handling > should ( in my o

Re: [akka-user] Handling spray.json.DeserializationException in akka-http route

2017-04-25 Thread Andras Szerdahelyi
Alan, thanks. This looks excessively complex, given how the existing exception handling should ( in my opinion ) take care of this. I've written a test around it, and found that the exception handler is never called for an exception bubbling up from the json format via entity(as[Object]). It is ca

Re: [akka-user] Offset type and resumable projections for 2.5

2017-04-25 Thread Richard Rodseth
Fair enough. Thanks. On Tue, Apr 25, 2017 at 4:50 AM, Akka Team wrote: > I don't find that sample odd or doing something inherently bad. > > You might choose to serialize the whole Offset subtype, but you might also > decide to serialize the long-value which will take considerable less space, >

[akka-user] Custom Sink:with CompletionStage - onPush() only get one element, why?

2017-04-25 Thread Guofeng Zhang
Hi, I create a custom sink following the sample in Custom stream processing , When the onPush() implemented like the sample: public void onPush() throws Exception { Integer element = grab(in); System.out.println(el

Re: [akka-user] Re: enable hostname / domain name on Akka Http for SSL

2017-04-25 Thread Abdeali Chandanwala
I am still not able to solve the SSL issue on my server - can anyone please guide Regards On Wed, Apr 19, 2017 at 1:55 PM, Abdeali Chandanwala wrote: > Hi > Arnout, Thanx for your point ...you are right and I have opened the HTTPS > port 443 on AWS Security Group but I am Sorry to inform that it

Re: [akka-user] Handling spray.json.DeserializationException in akka-http route

2017-04-25 Thread Alan Burlison
On 25/04/2017 00:13, Andras Szerdahelyi wrote: I have a need to encode exception messages in to a specific JSON format in my http responses. I was wondering how I could catch a DeserializationException in my route or outside of it or encode the DeserializationException. Here's how I did it so

Re: [akka-user] Akka Best Practice

2017-04-25 Thread Justin du coeur
On Tue, Apr 25, 2017 at 6:21 AM, Vishwa Bhat wrote: > Suppose there is a sequence of dependant operations say: > > a. Build X > > b. Insert X into Database > > c. Find Y in the Database > > d. Get Z from some Computation and return it > > Assuming all the above operations are blocking. > > [...]

Re: [akka-user] Uncaught error from thread shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem

2017-04-25 Thread Roland Kuhn
Well, the screenshot shows the error quite clearly: the native library for leveldb is not found. Regards, Roland > 25 apr. 2017 kl. 08:27 skrev Sachin S V : > > I am running an assembly jar file in command prompt and getting the > exception below. And resulting in termination. > > Uncaught

Re: [akka-user] Akka queue stream recover and drop element back in top

2017-04-25 Thread Akka Team
Recover will catch an exception coming from upstream and continue by emitting a single element before completing. Indeed does not sound like what you are after. Maybe the retry stream in akka-stream-contrib could give you some inspiration on how to solve your problem: https://github.com/akka/akka-

Re: [akka-user] Offset type and resumable projections for 2.5

2017-04-25 Thread Akka Team
I don't find that sample odd or doing something inherently bad. You might choose to serialize the whole Offset subtype, but you might also decide to serialize the long-value which will take considerable less space, may be possible to read directly from a database etc. I consider that design decisi

Re: [akka-user] Apply different functions on SubFlows

2017-04-25 Thread Akka Team
Partition allows you to look at a message and decide which of its outlets to pass the element to, this way you can design the logic of each sub stream independently. Something like this: val flow: Flow[Int, Int, NotUsed] = Flow.fromGraph(GraphDSL.create() { implicit builder => import GraphDSL.

Re: [akka-user] Could not access type LoggingAdapter in value akka.event

2017-04-25 Thread Akka Team
Akka 2.3 has recently been end-of-lifed, please upgrade to 2.5.0 or 2.4.17. Spray has been end of lifed, superseded by Akka HTTP, so you should definitely think about migrating. The problem you are seeing is probably spray or some other library depending on a newer Akka version than 2.3.14 -- Joh

[akka-user] Akka Best Practice

2017-04-25 Thread Vishwa Bhat
I have been playing around with Akka-Java to learn writing concurrent application using Actors. I have previously worked on Java CompletableFutures extensively. There are few things which I could not figure out despite searching for them on internet. Suppose there is a sequence of dependant op

Re: [akka-user] Idiomatic way to use akka stream Source within Spark

2017-04-25 Thread Akka Team
I think this question has a higher chance of getting an answer if asked in the Spark community/mailing list. The linked project seems to be more about feeding data from Akka Streams into spark than running Akka Streams inside of Spark. -- Johan Akka Team On Fri, Mar 17, 2017 at 8:49 PM, Kyrylo

Re: [akka-user] How to get all the Actors that are holding a particular web socket endpoint using Play framework?

2017-04-25 Thread Akka Team
For more Play Framework specific answers I'd ask on the play mailing list instead. In general: If it has to be actors representing the websockets I'd let them register to a registry/broadcast actor that will keep a list of current web sockets (using watch to know if they terminate for example) an

Re: [akka-user] Is Akka Multi Node Testing available in Java

2017-04-25 Thread Akka Team
Hi Dai, I'm afraid it is currently only possible to run the multi-node tests with Scala + SBT -- Johan Akka Team On Wed, Mar 22, 2017 at 3:11 AM, Dai Yinhua wrote: > Anybody knows how to run akka multi node testing in java? > Is there any example code? > > -- > >> Read the docs: http:

Re: [akka-user] Akka-Java Routing Issue

2017-04-25 Thread Arnout Engelen
There's a number of possibilities: if the processing is stateless you could use the 'ask' and 'pipe' patterns and 'map' ( http://doc.akka.io/docs/akka/current/java/futures.html#Use_with_Actors ). Another approach might be to wrap the messages to and from the child actors in an 'envelope' that also

Re: [akka-user] Akka-Java Routing Issue

2017-04-25 Thread Vishwa Bhat
Nice, That's one solution but what if I have to do some processing on 'MainActor' when I get response from child and then I have to send to 'MyApp'? Regards, Vishwa On Tuesday, April 25, 2017 at 1:38:09 PM UTC+5:30, Arnout Engelen wrote: > > Hi Vishwa, > > You correctly noticed that, when handl

Re: [akka-user] How To parallel compute in streams

2017-04-25 Thread Arnout Engelen
Perhaps mapAsync ( http://doc.akka.io/api/akka/2.5/akka/stream/javadsl/Flow.html#mapAsync[T](parallelism:Int,f:akka.japi.function.Function[Out,java.util.concurrent.CompletionStage[T]]):akka.stream.javadsl.Flow[In,T,Mat] ) might come in handy here? On Tue, Apr 25, 2017 at 10:25 AM, wrote: > Hello

[akka-user] How To parallel compute in streams

2017-04-25 Thread lukas . ciszewski
Hello, i implemented the example from http://fruzenshtein.com/simple-akka-use-case/ and wonder how to implement this pattern as akka streams. Especially the line for dynamic actor spawning confuses me. files.foreach(file => context.actorOf(FileReaderActor.props) ! file) Which pattern in akka

Re: [akka-user] Akka-Java Routing Issue

2017-04-25 Thread Arnout Engelen
Hi Vishwa, You correctly noticed that, when handling the Integer message that was sent to the 'MainActor' by your child actor, 'sender()' will refer to that child actor. If you want the response to go to the 'original' sender ('MyApp'), one solution might be to use 'sender()' as the second parame

[akka-user] Akka-Java Routing Issue

2017-04-25 Thread Vishwa Bhat
I have the following issue in Akka-Java. I have one Parent Actor `MainActor.class` and this parent has 5 child routes. Following is the hierarchy: *My App => Main Actor => [Child Route-1,Child-Route-2,..]* Simple Use case is String input is parsed to Integer as output: *MyApp ===ask[string in