[akka-user] akka-persistence and routing

2014-12-23 Thread Tal Pressman
Hi, I have a system that receives messages and has to route them (based on some complicated logic) to a number of destinations reliably (with at-least-once semantics). It seems that the most natural way to achieve the routing part is to create a Router with custom RoutingLogic. The

Re: [akka-user] akka-persistence and routing

2015-01-11 Thread Tal Pressman
/2.3.8/scala/routing.html#Custom_Router ? -Endre On Tue, Dec 23, 2014 at 1:00 PM, Tal Pressman kir...@gmail.com javascript: wrote: Hi, I have a system that receives messages and has to route them (based on some complicated logic) to a number of destinations reliably (with at-least-once

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-10 Thread Tal Pressman
Hi, Thanks for your response. Let me (try to) clarify my questions. I guess I oversimplified my example so it, so I'll try again. I have an actor (persistent with at-least-once-delivery), and I want it to process messages immediately upon arrival. That is, I don't want to wait for the

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-08 Thread Tal Pressman
and the state will be picked up at consistent point, and sent of to the snapshot store, and then normal processing of messages will continue inside the actor. If the state is mutated while in flight to the snapshot store, then all bets are off. B/ On 3 March 2015 at 16:38:39, Tal Pressman (kir

[akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-03 Thread Tal Pressman
Hi, Sorry in advance if this has already been answered somewhere, I couldn't find it... I have a PersistentActor, and I use persistAsync to persist its events. Now I want to add snapshots into the mix. So from what I understand from the documentation, having a snapshot with a timestamp T

[akka-user] Overriding default configuration

2015-04-14 Thread Tal Pressman
Hi, I am working on an application that has an application.conf file (under src/main/resources) with some application-specific configuration. When I build (package) the application, the application.conf gets copied into the JAR file and Akka loads it as expected (using ConfigFactory.load()).

[akka-user] Re: Overriding default configuration

2015-04-16 Thread Tal Pressman
Thanks for your reply. That's probably what I'll end up doing... For some reason, all the documentation and questions seem to assume the config file should be a resource, so I just went with that. On Tuesday, April 14, 2015 at 7:15:17 PM UTC+3, Adam wrote: First of all, regardless of

[akka-user] Re: Announcement: Opinionated RabbitMQ library using Akka / Reactive Streams

2015-05-27 Thread Tal Pressman
Hi Tim, This looks great - I was just thinking of implementing something like this myself, so the timing couldn't have been better. ^_^ I do have a couple of questions, though. From what I see in AsyncAckingConsumer, the default error handling strategy is to acknowledge the message once the

Re: [akka-user] Announcement: Opinionated RabbitMQ library using Akka / Reactive Streams

2015-05-28 Thread Tal Pressman
On Thursday, May 28, 2015 at 1:26:28 AM UTC+3, Tim Harper wrote: You're right; after the retry amount, the messages are lost. Also, worse, is that message order is not maintained. This makes the recovery strategy good only when message order does not matter. I had to do this because I use

Re: [akka-user] Announcement: Opinionated RabbitMQ library using Akka / Reactive Streams

2015-07-13 Thread Tal Pressman
Hi Tim, Sorry to disappear on you like that, priorities got shifted a little here and I had to work on something else for a while. I'm back to working on this now, though, and it seems like there have been a lot of changes in the meantime! So I created a new project, started with the sample

Re: [akka-user] Announcement: Opinionated RabbitMQ library using Akka / Reactive Streams

2015-07-21 Thread Tal Pressman
On Jul 13, 2015, at 06:55, Tal Pressman kir...@gmail.com javascript: wrote: Hi Tim, Sorry to disappear on you like that, priorities got shifted a little here and I had to work on something else for a while. I'm back to working on this now, though, and it seems like there have been a lot

Re: [akka-user] SharedLeveldbJournal questions

2015-11-03 Thread Tal Pressman
ue <https://github.com/akka/akka/issues> (and > contributions are also very welcome). > > Regards > Patrik > > On Wed, Oct 14, 2015 at 1:06 PM, Tal Pressman <kir...@gmail.com > > wrote: > >> Hi, >> >> Now that Akka 2.4 is released with the new persistence-query A

[akka-user] SharedLeveldbJournal questions

2015-10-14 Thread Tal Pressman
Hi, Now that Akka 2.4 is released with the new persistence-query APIs, we upgraded Akka in our application. After doing some searching, I couldn't find any persistence-query plugins yet, so in the meantime I switched to the shared LevelDB plugin. So functionally, everything works now, and I

[akka-user] Akka 3.4.0 Persistence, Persistence Queries - dependencies and migrations

2015-09-07 Thread Tal Pressman
Hi, Akka 2.4 is coming, bringing with it Persistence Queries, which for the most part look really great. However, there are some issues with it that I find problematic. The first regards dependencies - 2.4.0 deprecates PersistentView, but the recommended classes are part of an entirely

[akka-user] Re: PersistenceQuery.ReadJournal vs PersistentActor.onReceiveRecover

2016-01-04 Thread Tal Pressman
Hi, Here's the way I think about it - the PersistenceQuery provides the part of your system that reads and processes events. This part of the system only uses PersistenceQuery, and doesn't need any PersistentActors. The other part of the system is the one that persists the events. This can

[akka-user] Architecture question: Persistent back-pressured low latency message processing

2015-12-27 Thread Tal Pressman
Hi, I'm trying to design a system that reads messages from an external source, does some processing, and sends them to external destinations, that has the following requirements (arranged by priority): 1. No message loss. All message processing has to be done using at-least-once

[akka-user] Re: Architecture question: Persistent back-pressured low latency message processing

2015-12-28 Thread Tal Pressman
es in Kafka and you akka system process them > in a back-pressured way with at-once-leas-devery. I hope this tips help you. > > On Sunday, December 27, 2015 at 8:52:01 AM UTC-2, Tal Pressman wrote: >> >> Hi, >> >> I'm trying to design a system that reads m

Re: [akka-user] Architecture question: Persistent back-pressured low latency message processing

2015-12-27 Thread Tal Pressman
ay around this > conflict. Any middle ground will be a compromise of the kind "at-least-once > but only for X% of the cases", meaning that resolving this conflict is a > genuine business decision. > > Regards, > > Roland > > Sent from my iPhone > > On 27 Dec 2015,

[akka-user] Re: Architecture question: Persistent back-pressured low latency message processing

2015-12-29 Thread Tal Pressman
ssage was persisted into kafka. The external app use > your app in a request-response fashion or in a publish jobs fashion? > Em segunda-feira, 28 de dezembro de 2015 06:27:51 UTC-3, Tal Pressman > escreveu: >> >> Hi, >> >> That's an interesting approach. In your archi

[akka-user] Persistence/CQRS: Persisting events without recovery

2016-06-22 Thread Tal Pressman
Hi, We're writing a system that has 2 components: 1 that generates a (persistent) stream of events, and another that subscribes to the stream and processes the events. We want to use akka-persistence but there are some things we're not quite sure about. The current design uses a

[akka-user] Re: Persistence/CQRS: Persisting events without recovery

2016-06-23 Thread Tal Pressman
ocumented in the Recovery section of the docs: > http://doc.akka.io/docs/akka/current/scala/persistence.html > > HTH, > > Mark > > On Wednesday, 22 June 2016 08:59:36 UTC+1, Tal Pressman wrote: >> >> Hi, >> >> We're writing a system that has 2

[akka-user] Re: Is Akka Persistence production ready.

2016-06-28 Thread Tal Pressman
Hi, As far as I know, the LevelDB plugin is not intended for production, but only for development. For a reliable solution you should use a different backend (Cassandra, for example). Tal On Tuesday, June 28, 2016 at 1:08:24 PM UTC+3, Vishal Singh wrote: > > Hi Guys, > > I am using Akka

[akka-user] Re: I seems to me that AbstractActorPublisher only supports polling from upstream flows?

2016-01-31 Thread Tal Pressman
>From what I know, RS specify that a producer can only push data when there is demand for it downstream, in order to avoid flooding the downstream. Think about a case where the producer produces a huge amount of messages before the downstream even time to react and ask it to throttle itself -

[akka-user] Java-friendly "ask"

2016-02-24 Thread Tal Pressman
Hi, As far as I can tell, "ask" currently only returns a Scala Future. Is there also a more Java-friendly version that returns a CompletionStage? Thanks, Tal -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >>

Re: [akka-user] Java-friendly "ask"

2016-02-24 Thread Tal Pressman
Hmm, not sure why I didn't find it myself. Sorry for the dumb question... Thanks for the quick reply, though! ^_^ -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the

[akka-user] Re: Ensure that Soure[A] is not empty

2016-02-25 Thread Tal Pressman
> > a Source's may simply not be ready > a Source's *data* ... On Thursday, February 25, 2016 at 3:59:39 PM UTC+2, Tal Pressman wrote: > > I don't think there's a general way to achieve this - a Source's may > simply not be ready yet at any given point in time. > But for

[akka-user] Re: Ensure that Soure[A] is not empty

2016-02-25 Thread Tal Pressman
I don't think there's a general way to achieve this - a Source's may simply not be ready yet at any given point in time. But for your use-case, can't you simply wait with the file creation until you actually get data from the stream? Tal On Thursday, February 25, 2016 at 2:12:04 PM UTC+2,

[akka-user] [Stream] Connecting arbitrary number of graphs with materialized values

2016-02-25 Thread Tal Pressman
Hi, I find myself needing a way to send messages to several sinks, while aggregating their materialized values. Trying to use the GraphDSL, I can either: - Pass a static number of graphs to GraphDSL.create and use their materialized values, or - Call builder.add for each graph, but

Re: [akka-user] [Stream] Connecting arbitrary number of graphs with materialized values

2016-02-26 Thread Tal Pressman
n of tuples). What is exactly what you > want to achieve? > > -Endre > > On Thu, Feb 25, 2016 at 3:50 PM, Tal Pressman <kir...@gmail.com > > wrote: > >> Hi, >> >> I find myself needing a way to send messages to several sinks, while >> aggregating th

Re: [akka-user] [Stream] Connecting arbitrary number of graphs with materialized values

2016-02-26 Thread Tal Pressman
This isn't actually a matter of size - I don't expect that I'll have too many sinks, I just don't know how many I'll have ahead of time. Tal On Friday, February 26, 2016 at 2:49:16 PM UTC+2, drewhk wrote: > > > > On Fri, Feb 26, 2016 at 1:45 PM, Tal Pressman <kir...@gmail

[akka-user] Re: Can I Pause some Flow In the the akka-stream?

2016-02-21 Thread Tal Pressman
I don't know of any way to do it out of the box, but you can create your own custom GraphStage that handles the pause/resume logic, and when it's paused doesn't push/pull. On Sunday, February 21, 2016 at 4:19:54 PM UTC+2, 代小飞 wrote: > > I have know about we can build flow graph use the sink

[akka-user] Re: Akka Actor Hierarchy Question

2016-03-15 Thread Tal Pressman
Hi, Basically it boils down to which actors should supervise others - if you want to have a single actor responsible for supervising all the chat rooms that's fine. Note that this *doesn't* mean that all requests have to be routed through the supervisor actor. Messages can be sent between any

Re: [akka-user] [Stream] Connecting arbitrary number of graphs with materialized values

2016-03-07 Thread Tal Pressman
erialized values. Then recurse to do *n*. > > Hbf. > > On Friday, 26 February 2016 05:02:34 UTC-8, Tal Pressman wrote: >> >> This isn't actually a matter of size - I don't expect that I'll have too >> many sinks, I just don't know how many I'll have ahead of time. >&

[akka-user] Re: Event before kill an actor

2016-03-07 Thread Tal Pressman
Have a look at postStop. Tal On Monday, March 7, 2016 at 10:09:51 AM UTC+2, tharindu ranasingha wrote: > > Hi, > > Is there any event triggered before killing an actor. I am looking for a > event like 'doBeforeUnload' in javascript. > I need it for clean some resources used and close file that

Re: [akka-user] Re: Does each ActorMaterializer need its own ActorSystem?

2016-03-02 Thread Tal Pressman
In our application we create a new ActorMaterializer for each stream, but only 1 ActorSystem and there are no problems with it. In another part of the application we also have a single a single ActorMaterializer that is used to create many streams. Tal On Wednesday, March 2, 2016 at 11:22:49

[akka-user] Re: Is there a way to get the supervisor actorref of an actor?

2016-03-03 Thread Tal Pressman
The supervisor is always the actor's parent. I'm not aware of a direct way to get the ActorRef for the parent from outside the actor, but you could get its path using actorRef.path.parent Tal On Thursday, March 3, 2016 at 3:07:31 AM UTC+2, Remko de Jong wrote: > > Just playing around a bit

Re: [akka-user] postStop doesn't get invoked after actor initialization failure

2016-03-31 Thread Tal Pressman
the double-failure solution. Tal On Thursday, March 31, 2016 at 4:23:19 PM UTC+3, drewhk wrote: > > > > On Thu, Mar 31, 2016 at 3:10 PM, Tal Pressman <kir...@gmail.com > > wrote: > >> >> Here's my (unimportant and unsolicited ^_^) opinion. >> I th

Re: [akka-user] postStop doesn't get invoked after actor initialization failure

2016-03-31 Thread Tal Pressman
Here's my (unimportant and unsolicited ^_^) opinion. I think this should be left as is for a couple of reasons. 1. In the case you mentioned where a file is opened in the c'tor, the file could have been opened during preStart. That way if you allocate the resource, you will get to postStop, and

[akka-user] Re: Akka Persistence - AtLeastOnceDelivery: How to get unlimited number of unconfirmed messages without running out of memory

2016-08-10 Thread Tal Pressman
Hi, >From what I know, you can't do this using just a single PersistentActor, since you have no control of the incoming message rate (even if you just persist the messages and don't keep them in memory after that, they could arrive faster than the journal can persist them). If we assume that

[akka-user] FSM convenience matcher - Ev

2017-02-12 Thread Tal Pressman
Hi, The FSM JavaDoc mentions a convenience matcher called Ev for matching events without the data, but I can't find the actual matcher (or any reference to it in the main docs). Does it actually exist, or is it a "bug" in the JavaDoc? Thanks, Tal -- >> Read the docs:

[akka-user] Re: Cluster on different nodes minimally sharing code

2017-02-15 Thread Tal Pressman
Hi, So here's a question - why do you want to have the manager and workers in the same cluster? If they are, indeed, so decoupled that they should run on separate machines, why not just have 2 separate clusters (or a cluster for the workers, and a separate non-cluster process for the manager)?

[akka-user] Re: Are messages ordered in activator hello akka java8 tutorial?

2016-09-05 Thread Tal Pressman
Hi, Message ordering is preserved between a sender-receiver pair. However, this refers to the actual actual actor sending the message, regardless of the ActorRef passed as the sender reference. In the example above, both messages are being sent from the same context, and therefor should be

[akka-user] Re: Trouble understanding Streams doc for Scala: new user question

2016-10-06 Thread Tal Pressman
Hi, The type provided to Source.actorRef is the type of the messages emitted from the Actor (WorkResult in your case). Success messages can be *sent to the actor* in order to cause the stream to complete, but they are handled separately and aren't actually emitted to the stream. As for

[akka-user] Re: Are messages ordered in activator hello akka java8 tutorial?

2016-09-07 Thread Tal Pressman
think. So, is the example not dealing with the possibility that the > messages could be received out of order? Or, is this somehow taken care of? > > Kendall > > On Monday, September 5, 2016 at 2:40:34 AM UTC-7, Tal Pressman wrote: >> >> Hi, >> >> Message orde

[akka-user] Re: [akka-persistence] Design question, account with transactions

2016-08-17 Thread Tal Pressman
t; May you share some info about your system: > - how many actors do you have per JVM > - how many transactions are kept in memory per actor > - what backend do you use for journal > > середа, 17 серпня 2016 р. 09:38:12 UTC+3 користувач Tal Pressman написав: >> >> Hi, &

[akka-user] Re: [akka-persistence] Design question, account with transactions

2016-08-17 Thread Tal Pressman
Hi, We have something similar to the in one of our systems, and the way we did it is to include the list of processed transactions (IDs) as part of the actor state. In places where it isn't feasible to keep all transactions in memory, you can use a bloom filter (if you don't require 100%

[akka-user] Re: Akka FSM, persistence and timeouts

2016-09-26 Thread Tal Pressman
Hi, One possible solution using PersistentFSM would be to save the persist with the timestamp when it happened, and then when applying the event you could set a timer (using setTimer or system.scheduler) that would trigger the state change. This way, when the events are processed during

[akka-user] Re: how to limit mapasyncunordered concurrency

2016-09-26 Thread Tal Pressman
Hi, I think you're confusing some things here. Both mapAsync and mapAsyncUnordered limit the parallelism level in a similar way, the difference is whether or not they emit the results in the order they were received. In other words, mapAsyncUnordered(8) will read 8 messages and start

Re: [akka-user] Abstracting away CommitableMessage

2016-10-27 Thread Tal Pressman
Hi, I started working on something similar for akka-contrib (https://github.com/akka/akka-stream-contrib/issues/50). There is a PR there with a "basic" implementation that also supports filtering and splitting messages (and materialized values), but I got a little stuck trying to generalize

Re: [akka-user] ActorSelection.resolveOne from Java

2016-11-24 Thread Tal Pressman
alawski > Akka <http://akka.io> @ Lightbend <http://lightbend.com> > > On 24 November 2016 at 09:45:00, Tal Pressman (kir...@gmail.com > ) wrote: > > Hi, > > When using akka-remote, the documentation says to use the > ActorSelection.resolveOne method to res

[akka-user] Re: Missing api GraphStageLogic

2016-10-13 Thread Tal Pressman
Just change the visibility from 'public' to 'all' Tal On Thursday, October 13, 2016 at 9:37:41 AM UTC+3, Ortigali Bazarov wrote: > > In documentation, there is a example how to use GraphStageLogic's pull, > push, emit and etc methods. But when i looked for their's signature in > here >

[akka-user] Re: Snapshots

2017-01-07 Thread Tal Pressman
If I am not mistaken, persistence-query does not support snapshots so you would have to save the snapshot along with your offset, and then for recovery you should load it manually and restart the persistence-query from the saved offset. Tal On Thursday, January 5, 2017 at 4:21:36 PM UTC+2,

[akka-user] Re: Best hardware for Akka development

2017-01-02 Thread Tal Pressman
I understand the frustration that SBT can cause, but from my experience (working on Windows, Mac, and some Linux) the differences are barely noticeable. The command-line tools generally run just as well on any of the platforms, IDEs run fairly similarly (barring different shortcuts...), and

[akka-user] Re: Snapshots

2017-01-08 Thread Tal Pressman
Still, I don't think you can get snapshots that were saved by the "original" persistent actor through the persistence query. It's fairly easy to check, though - just save a snapshot and see if you can read it from the query. In any case, what I meant is that instead of only saving the offset

[akka-user] Re: How to stream java 8's CompletionStage

2016-12-25 Thread Tal Pressman
Hi, Generally speaking, using asynchronous APIs in a stream is achieved by using mapAsync (or mapAsyncUnordered) instead of map. I'm not sure I understand what exactly you mean about the source emitting messages/batches, but mapAsync works with back-pressure, and has configurable parallelism

[akka-user] Re: How to listen to events on CassandraJournalProvider ?

2017-03-12 Thread Tal Pressman
Hi, I think the name for Persistence Query is a little misleading - when I first heard it I imagined something like an SQL query that can run over the data source, but that's not what it is. What it actually does is set up an Akka stream source that handles the events from the data store. The

[akka-user] Re: Full network partition and healing in combination with auto-down disabled

2017-07-17 Thread Tal Pressman
Hi, My understanding is that turning off auto-downing means that there are only 2 ways to mark a node as down: 1. The node leaving the cluster "gracefully" 2. Manually downing the node via API So in your use-case, the cluster should recover after the network heals. (Take this with a

[akka-user] PersistentFSM API musings

2017-08-16 Thread Tal Pressman
Hi, We've been using Persistent FSMs for a while now, and really like them - the combination of the structure and functional state with event sourcing is really useful for us in many cases. However, there are some places where the API feels a bit strange, or that it's missing some things, and

[akka-user] Re: PersistentFSM API musings

2017-08-27 Thread Tal Pressman
tp://doc.akka.io/docs/akka/2.5.3/scala/persistence.html#a-simple-example > > > Thanks, > Leonid > > On Wednesday, August 16, 2017 at 8:51:36 PM UTC+3, Tal Pressman wrote: >> >> Hi, >> >> We've been using Persistent FSMs for a while now, and really like them - >

[akka-user] akka-persistence-cassandra and Google search results

2017-12-01 Thread Tal Pressman
Hi, Although the Cassandra persistence plugin was migrated into Akka, searching for it on Google still points to Martin's old repository. For someone who's "been around" the Akka ecosystem for a while, this is just an annoyance (the easiest way to get to the "correct" repo is to go to the old

[akka-user] Re: Actors Initialization order.

2017-10-19 Thread Tal Pressman
Hi, Can you clarify a bit what you're trying to do? Are the children and grandchildren supposed to be Actors? What's a Node? Generally speaking, if you want actor1 to be actor2's parent, then actor1 has to be the one creating actor2. Even then, all actor1 will have is an ActorRef, not a

[akka-user] Akka typed ask and Scheduler

2017-12-31 Thread Tal Pressman
Hi, In "regular" untyped Akka, using `ask` only requires an implicit `Timeout` whereas the typed version also requires a `Scheduler`. Other than the fact that this isn't mentioned in the documentation (and hidden away in `TypedSpec` in the test code), I wonder if it is really necessary -

[akka-user] Re: visualize a Flow

2018-01-21 Thread Tal Pressman
Hi, Don't know if this is what you meant, but I came across travesty today and it looks nice. (disclaimer: I haven't actually used it, so no idea whether it actually works). Tal On Friday, January 19, 2018 at 12:33:48 PM UTC+2, Matteo Moci wrote: >

[akka-user] Re: [Akka-Streams] Want to always receive latest element in Sink

2018-01-24 Thread Tal Pressman
Hi, I don't know if there is any built-in graph that does this, but you can implement your own graph stage for this fairly easily. You just need a stage with an Option[Value], in the onPush you either push the value downstream or store it, and in any case you pull. In the onPull you just have

Re: [akka-user] Akka typed - first impressions

2018-01-30 Thread Tal Pressman
ething...) Tal On Sunday, January 28, 2018 at 5:49:53 PM UTC+2, Patrik Nordwall wrote: > > Hi Tal, > > Thanks a lot for taking it for a spin and sharing feedback. Comments > inline... > > sön 28 jan. 2018 kl. 14:10 skrev Tal Pressman <kir...@gmail.com > >: > >

Re: [akka-user] Akka typed - first impressions

2018-02-04 Thread Tal Pressman
t documentation: > https://doc.akka.io/docs/akka/snapshot/typed/index.html > > Cheers, > Patrik > > > On Tue, Jan 30, 2018 at 10:27 AM, Tal Pressman <kir...@gmail.com > > wrote: > >> Hi Patrik, >> >> Thanks for pointing me at the actor-to-actor pu

Re: [akka-user] Slow reactive-kafka consumer when running multiple streams

2018-02-12 Thread Tal Pressman
Hi, We have several streams in the same runtime and it works fine. We did, however, have problems when trying _a lot_ of consumers (~100, iirc), and ended up sharing. Tal On Tuesday, February 13, 2018 at 1:37:24 AM UTC+2, rrodseth wrote: > > Anyone else running more than one stream in a

[akka-user] Re: [Akka Streams] Feedback on custom throttle stage

2018-03-06 Thread Tal Pressman
Hi Dolly, There's something I don't understand from your requirements - do you want to delay messages and only push them based on the timer? If you don't need the timer, a simpler implementation could be something like this: onPush: save element pull if pulled, push the event onPull: