[akka-user] How could I know if a streams completed from the outside

2016-09-26 Thread Guofeng Zhang
Hi,

I have defined a publisher actor and subscriber actor. How could I know if
the stream has been completed from the outside (where I create the stream)?

Thanks for your help.

Guofeng

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Merging more than two Akka Stream Sources with materialized values

2016-09-26 Thread oleksiys
Thank you Patrik!

On Saturday, September 24, 2016 at 10:10:03 AM UTC-7, Patrik Nordwall wrote:
>
> Take a look at MergeHub. It's rather new.
> http://doc.akka.io/docs/akka/2.4/scala/stream/stream-dynamic.html
>
> /Patrik
> lör 24 sep. 2016 kl. 00:53 skrev oleksiys  >:
>
>> Hi guys,
>>
>> I need to merge mutliple sources Seq[Source[A, Mat]] and as an output get 
>> something like Source[A, Seq[Mat]].
>> For now I just merge sources in pairs using mergeMat, but I have a doubt 
>> that the merged Source will distribute the demand fairly among the 
>> underlying sources, because AFAIK my merged source will finally look like: 
>> (source-1, (source-2, (source-3 ... (source-N-1, source-N)... and 
>> assuming random demand distribution - the larger the N is - less chances 
>> that source-N will ever see any demand. Is that correct?
>>
>> There is a Source.combine method, that does almost exactly what I need, 
>> but unfortunately it wipes all the Mats information.
>>
>> Do you have any suggestion how I can achieve that?
>>
>> Thank you!
>>
>> WBR,
>> Alexey
>>
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >> Search the archives: https://groups.google.com/group/akka-user
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-26 Thread Eugene Dzhurinsky
Zhenya, thanks for the reply!

Actually at this point I see that there're no benefits on using of Akka 
Persistence, I could easily use some K/V storage to store the key as the 
workflow ID and value - the state of the actors, so upon recovery I could 
read from that storage and recreate the FSM actors with their 
states/timeouts set.

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-26 Thread Evgeny Shepelyuk
Hello

We're trying to implement something similar (i.e. when Actor recovered, we 
want side-effects to not happen again).
During recovery, events are not applied immediately to internal state, but 
we're waiting until recovery is completed and then decide what to do next, 
based on latest replied event.

In fact, it's identical to cleaning journal upto latest event after each 
successful event storage.


понеділок, 26 вересня 2016 р. 17:55:27 UTC+3 користувач Eugene Dzhurinsky 
написав:
>
> Tal, thanks for the response!
>
> As far as I know, when an actor is recovered through Akka Persistence - 
> the whole set of events is being re-send to the actor, so it can recover 
> the state. In my case, some states will have side-effects, like "send an 
> e-mail" or "update the database". Obviously I don't want those events to be 
> "replayed" by the new actor, I just need to
> - set the state data as it was seen when actor was "terminated"
> - set the timeouts (calculate the current time and recent state change 
> time to set the appropriate timeout)
> - set the state to start from.
>
> So I need not only record the state data and the current state, but also 
> the time when that state was changed.
>
> Do I need to write some custom persistence model for that or I still can 
> re-use Akka Persistence with some settings regarding the message replay 
> policy?
>
> As for the number of threads my concern is: I have 1 of actors, and 
> all of them have certain timeouts. Once they recover the state after the 
> actor system restart - there might be some bottleneck in processing of the 
> new incoming messages from the external system (e.g to start a new actor 
> that serves another workflow and init it's states) and process the timeout 
> events.
>
> Thanks!
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to configure cluster for two machines

2016-09-26 Thread Gerard W
Hi,
It would be very helpful if you give any hint on this.
Thank you


El jueves, 22 de septiembre de 2016, 13:12:59 (UTC-3), Gerard W escribió:
>
> I'm sorry, I did not mention (nor remember :-P) that I was overriding that 
> configuration setting to 2552 in my java code.
> So, to make it coherent I removed the override from the code and changed 
> the configuration of HostA to the following:
>
> akka {
>   actor {
> provider = "akka.cluster.ClusterActorRefProvider"
>   }
>   remote {
> log-remote-lifecycle-events = off
> netty.tcp {
>   hostname = "192.168.2.21"
>   port = 2552
> }
>   }
>   cluster {
> seed-nodes = [
>   "akka.tcp://MulticastPocCluster@192.168.2.21:2552"]
>   }
> }
> akka.cluster.metrics.enabled=off
> akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"]
>
> akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native
>
> In hostB the configuration remains unchanged:
>
> akka {
>   actor {
> provider = "akka.cluster.ClusterActorRefProvider"
>   }
>   remote {
> log-remote-lifecycle-events = off
> netty.tcp {
>   hostname = "192.168.2.55"
>   port = 0
> }
>   }
>   cluster {
> seed-nodes = [
>   # Seed node in the other host
>   "akka.tcp://MulticastPocCluster@192.168.2.21:2552"]
>   }
> }
> akka.cluster.metrics.enabled=off
> akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"]
>
> akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native
>
> Again, when I try to start up the actor on HostB, I get the same error as 
> in my previous post:
>
> [INFO] [09/22/2016 11:21:45.895] 
> [MulticastPocCluster-akka.remote.default-remote-dispatcher-6] [akka.tcp://
> MulticastPocCluster@192.168.2.55:51361/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FMulticastPocCluster%40192.168.2.21%3A2552-1]
>  
> No response from remote for outbound association. Associate timed out after 
> [15000 ms].
> [WARN] [09/22/2016 11:21:45.899] 
> [MulticastPocCluster-akka.remote.default-remote-dispatcher-5] [akka.tcp://
> MulticastPocCluster@192.168.2.55:51361/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FMulticastPocCluster%40192.168.2.21%3A2552-0]
>  
> Association with remote system [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] has failed, address is now gated 
> for [5000] ms. Reason: [Association failed with [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552]] Caused by: [No response from 
> remote for outbound association. Associate timed out after [15000 ms].]
>
> Log from hostA:
>
> [INFO] [09/22/2016 11:20:59.344] [main] [akka.remote.Remoting] Starting 
> remoting
> [INFO] [09/22/2016 11:20:59.610] [main] [akka.remote.Remoting] Remoting 
> started; listening on addresses :[akka.tcp://
> MulticastPocCluster@192.168.2.21:2552]
> [INFO] [09/22/2016 11:20:59.625] [main] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] - Starting up...
> [INFO] [09/22/2016 11:20:59.722] [main] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] - Registered cluster JMX MBean 
> [akka:type=Cluster]
> [INFO] [09/22/2016 11:20:59.722] [main] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] - Started up successfully
> [INFO] [09/22/2016 11:20:59.757] 
> [MulticastPocCluster-akka.actor.default-dispatcher-2] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] - Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] is JOINING, roles []
> [INFO] [09/22/2016 11:20:59.770] 
> [MulticastPocCluster-akka.actor.default-dispatcher-2] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] - Leader is moving node 
> [akka.tcp://MulticastPocCluster@192.168.2.21:2552] to [Up]
> sep 22, 2016 11:21:00 AM kamon.sigar.SigarProvisioner provision
> ADVERTENCIA: Sigar library is already provisioned.
> [INFO] [09/22/2016 11:21:00.324] 
> [MulticastPocCluster-akka.actor.default-dispatcher-15] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.21:2552] - Metrics collection has started 
> successfully
>
> Log from hostB:
>
> [INFO] [09/22/2016 11:21:30.579] [main] [akka.remote.Remoting] Starting 
> remoting
> [INFO] [09/22/2016 11:21:30.749] [main] [akka.remote.Remoting] Remoting 
> started; listening on addresses :[akka.tcp://
> MulticastPocCluster@192.168.2.55:51361]
> [INFO] [09/22/2016 11:21:30.759] [main] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> MulticastPocCluster@192.168.2.55:51361] - Starting up...
> [INFO] [09/22/2016 11:21:30.829] [main] 
> [akka.cluster.Cluster(akka://MulticastPocCluster)] Cluster Node [akka.tcp://
> 

Re: [akka-user] Re: Akka Cluster (and Cluster Client) on Kubernetes

2016-09-26 Thread 'Ruben Wagner' via Akka User List
Hi,

it took me some time, to find some time. But finally I created a github 
project from my solution:
https://github.com/ouven/akka-k8s-seednode

Ruben

Am Dienstag, 19. Juli 2016 02:11:06 UTC+2 schrieb Ashley Aitken:
>
>
> Thanks for sharing Ruben.
>
> I was considering if it could be done without a fixed seed node.
>
> I am keen to see your github project when you have time.
>
>
> On 19 Jul 2016, at 3:44 AM, 'Ruben Wagner' via Akka User List <
> akka...@googlegroups.com > wrote:
>
> Hi,
>
> actually the configuration is a bit tricky, because you need to set a 
> fixed seed node, which is not fixed in Kubernetes. I looked at the 
> Cassandra pod and ported it to Akka Cluster (s. attached file). It derives 
> the config from the Kubernetes API and then starts the Akka Cluster. If the 
> kubernetes service does not exist yet, it has to fail fast, so it can be 
> restarted from the Kubernetes controller, that's why it throws an 
> exception. As an entry point in the main class one can use something like 
> this:
>
> ...
> val kubeConfig = KubernetesSeednodeConfig.getConfig("akka-kube")
> val config = kubeConfig.withFallback(ConfigFactory.load()).resolve()
> val system = ActorSystem("akka-kube", config)
> ...
>
> I will put this all together in a github project, when I find the time and 
> post the link here. Also I did not have the time to play around with, it is 
> not perfect and comes with no warranties.
>
> Ruben
>
> Am Montag, 18. Juli 2016 17:24:34 UTC+2 schrieb Mahmoud Atef:
>>
>> Did it work with you, I mean Akka cluster over kubernetes?
>>
>>
>> On Monday, March 2, 2015 at 7:44:13 PM UTC+2, Ashley Aitken wrote:
>>>
>>>
>>> Howdy All,
>>>
>>> Has anyone had any experience getting an Akka Cluster and Cluster Client 
>>> running on Kubernetes, e.g. on Google Container Engine (GCE)?
>>>
>>> I note the problem with Akka dropping messages when the host IP address 
>>> doesn't match the container virtual IP address.
>>>
>>> I note the solution in Akka 2.4.
>>>
>>> I would most appreciate anyone confirming if they have an Akka Cluster 
>>> running on Kubernetes (on GCE or not) and sharing any tips / hints.
>>>
>>> Thanks in advance,
>>> Ashley.
>>>
>>> -- 
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/akka-user/obBNWy1bixI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> akka-user+...@googlegroups.com .
> To post to this group, send email to akka...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
> 
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-26 Thread Eugene Dzhurinsky
Tal, thanks for the response!

As far as I know, when an actor is recovered through Akka Persistence - the 
whole set of events is being re-send to the actor, so it can recover the 
state. In my case, some states will have side-effects, like "send an 
e-mail" or "update the database". Obviously I don't want those events to be 
"replayed" by the new actor, I just need to
- set the state data as it was seen when actor was "terminated"
- set the timeouts (calculate the current time and recent state change time 
to set the appropriate timeout)
- set the state to start from.

So I need not only record the state data and the current state, but also 
the time when that state was changed.

Do I need to write some custom persistence model for that or I still can 
re-use Akka Persistence with some settings regarding the message replay 
policy?

As for the number of threads my concern is: I have 1 of actors, and all 
of them have certain timeouts. Once they recover the state after the actor 
system restart - there might be some bottleneck in processing of the new 
incoming messages from the external system (e.g to start a new actor that 
serves another workflow and init it's states) and process the timeout 
events.

Thanks!

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] how to set an node to seed please?

2016-09-26 Thread Patrik Nordwall
There is the API cluster.joinSeedNodes if you don't want to use config. See
docs for details.

/Patrik
lör 24 sep. 2016 kl. 11:43 skrev :

> If all nodes in cluster is normal node, none is seed.
> How to set one of nodes as seed please?
> I can't do this, no new node can join the cluster.
>
> Thanks
>
> --
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] XMPP API development in Scala

2016-09-26 Thread Taran saini
where to begin with and any powerful libraries for the same?
Which concepts do we need to master for the same apart from the actor 
system.
In short, the best approach to build xmpp apis.

Thanks

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[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 
processing them. Once it has demand from the downstream, it will emit the 
results of any completed future, and then read another message and start 
processing it.

Tal


On Sunday, September 25, 2016 at 5:59:34 PM UTC+3, sirpy wrote:
>
> The parallelism argument to mapasyncunordered doesn't seem to be effective.
> According to the docs it seems like it will backpressure only if 
> downstream also backpressures and futures count > parallelism.
> On the other hand mapasync is limited by parallelism but it must wait for 
> the first future in line to finish before starting the next one.
> So my question is how can i achieve the same effect as with mapasync but 
> using mapasyncunordered that the total amount of futures currently active 
> by mapasyncunordered is limited by the parallelism argument and as soon as 
> one future is done the next one will start (ie unordered).
>
> Thanks
> Hadar
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[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 recovery, the 
timer would be set properly.

Regarding the number of threads, there are a couple things:

   1. Number of threads is unrelated to the number of actors. Threads are 
   in charge of actually processing the messages, so what you have to consider 
   is how many messages you have to process, and how long this processing is 
   per message.
   2. Assuming you don't do any blocking during message processing adding 
   more threads will not improve your performance noticeably, as it will only 
   cause more context switches. If you do end up in a place where you can't 
   keep up with message processing, you would have to scale your system (up or 
   out).

Hope this helps,
Tal


On Thursday, September 22, 2016 at 5:14:40 AM UTC+3, Eugene Dzhurinsky 
wrote:
>
> Hello all!
>
> I have to create the simple workflow execution engine, that supports 
> timeouts in its states. The sample made-up definition and the sequence of 
> the states could be as following:
>
> 1) Send the confirmation e-mail to the customer *once*
> 2) Await the confirmation event for 24 hours
> 3) If there is a timeout error - then send another e-mail to the customer 
> with the reminder and wait for 48 hours
> 4) If there is the confirmation event - then complete the registration and 
> send welcome e-mail
> 5) if there's another timeout from step 3 - then cancel the registration 
> process and cleanup the database
>
> I think that I could easily create *10K-100K* of instances of the actors 
> in the JVM - actors seems to be cheap, however I'm not sure
> - how the timeouts for the states will be processed, could I jam into some 
> bottleneck with the scheduled events processing? What is the recommended 
> thread pool size for 10K of actors, ballpark value?
>
> - how do I *persist* the states of the workflow actors and *recover* them 
> with the correct timeouts, if for some reason actor dies on step 2 after 10 
> hours of waiting, and upon the restart I need to adjust the timeout to be 
> not 24 hours, but 14 hours. I know that I can start FSM with any state and 
> state data, perhaps I could also set the custom step timeout upon init of 
> the FSM.
>
> I think that I could create some sort of the database that may keep the 
> state and state data of each of workflows actor, but may be I am 
> reinventing the wheel and there's already some *akka-scheduler* contrib 
> module I overlooked?
>
> Thanks in advance!
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] What's the replacement for Akka Actor Publisher and Subscriber?

2016-09-26 Thread Dagny T
Hi there,

The latest info I have from a prior Akka Team response was that the Akka 
Actor Publisher/Subscriber APIs are now deprecated; 
and one should be looking at the Graph DSL instead.

i.e. Latest Akka Docs state:
ActorPublisher and ActorSubscriber
 cannot be used with remote actors, 
because if signals of the Reactive Streams protocol (e.g. request) are lost 
the the stream may deadlock.

So, now I'm not clear on what the replacement APIs we're supposed to be 
using; as far as connecting State-Holding Akka Actors to Graph DSL 
Event-Streams.

Is there an Akka Team Blog with a GitHub link to a small focused example 
which demonstrates this?

THANKS in advance for any help with finding the latest APIs to use for this!
Dagny


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Is back pressure triggered upon exceptions

2016-09-26 Thread Dagny T
Hi Kunal and Johannes,

THANKS for your posts on this -- as I was also wondering how 
exception-handling mid-Flow is supposed to work!

Followup questions for you, please:

- Let's say for simplicity that we have only 3 events flowing through a 
Streaming Flow with 5 Stages. 
- We put a Try block around the myGraph.run() materialization
- Then, say an exception happens on Stage 3, and Event 2.

1) Does this mean that the resulting Try collection will contain:
- Success w Result from Event 1, all Stages
- Failure w Exception from Event 2, Stage 3
- NOTHING for Event 3; as Materialized Graph would have just stopped on an 
exception

2) Does this then imply that Source has to somehow know Events 2,3 got 
dropped via the UUID of Event- last processed;
then it has to re-stream those to the Sink?

Please let me know if I'm understanding those two points correctly!

THANKS!
D

On Wednesday, September 14, 2016 at 10:49:18 PM UTC-7, Kunal Deshpande 
wrote:
>
> Hi, 
>
> I have been using Akka streams to implement a saved-search refresh system 
> as well as a notification processing system at my current company. 
>
> Recently we ran into a fast-publisher & slow subscriber problem where the 
> downstream HTTP services were taking a long time to respond resulting in 
> Timeout exceptions in our client. Currently we simply drop the event and 
> resume the stream using Supervision.Resume but I am unsure whether that 
> translates into back pressure.
>
> Few questions on back pressure
> 1. While using Flows in akka-streams using .via will a downstream flow 
> apply back pressure to a flow upstream or is back pressure only signaled to 
> a Source?
> 2. Will exceptions in a Flow trigger back pressure
> 3. Is there a mathematical way to represent back pressure and is it 
> consistent across different reactive streams implementations?
>
> Thanks, and really appreciate your time!
>
> Kunal
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Memory Bounding Akka Streams

2016-09-26 Thread Dagny T

OK Victor Klang:  would you please be so kind as to elaborate with some 
helpful details on your prior reply?  ;0)

1) My reading of the docs is that the '.buffer' API is necessary to handle 
the case where if the Source streams data faster than the Sink can handle 
it; then one can run into 'Out of Memory' errors on the Sink.  i.e. The 
(default) Akka Streams API does not assume any memory restrictions on the 
Sink.

Please let me know if I'm reading this correctly?

Otherwise, please explain what the (default) Akka Streams implementation 
does with bounding memory for a Stream of events running through it.

2) I found Kevin Weber's helpful blog about Akka Streams; but when I then 
Googled around to find out where the Subscriber.onNext(...) gets called; 
and I wasn't able to find a clear example of that; so I'm now guessing that 
call is buried somewhere inside of the implementation of the 
higher-level-abstraction Graph DSL APIs.

Please let me know if I'm reading this correctly? 

Otherwise, please just reply with a link to a GitHub repo to a focused 
source file which demonstrates correct usage of that API (i.e. would that 
have to somehow get called through some '.map' function on event-elements 
of a Stream, and what would that calling syntax even look like given a 
Graph specified with both broadcast and merge paths?)

3) My reading of the docs is that backpressure to the Source won't get 
triggered until N >= BUFFER_MAX elements specified in the 
Source.buffer(...) call.

Please let me know if I'm reading this correctly?

4) My reading of the docs is that Streams are of a uniform type; and that 
the number passed into the Source.buffer(...) call refers to the number of 
that type to be buffered, rather than just the number of Bytes.

Please let me know if I'm reading this correctly?  

Maybe I could also try this out with using a simple String sequence as the 
Source; and then varying the buffer to see what comes out to the Sink.

THANKS in advance for any details to advance my Newbie understanding of 
this!




On Wednesday, September 21, 2016 at 11:01:12 AM UTC-7, Dagny T wrote:
>
>
> Just wanted to check with folks if I had the correct implementation for 
> how to protect from blowing up memory when working with Akka Streams.
>
> I've merged a Lightbend Blog post's code, with the latest API changes for 
> Akka v2.4.9, and the latest documentation about buffered streams in the 
> v2.4.9 API Docs.
>
> However, none of those explain these questions I have.  Please see 
> question comments, regarding the code snippet below it!  THANKS in advance 
> for any insights!
>
> // TODO 3:  MODIFIED to calling buffered API within Graph mapping -- check 
> assumptions!
> //  - where INTERNAL Akka implementation calls onNext() to get next 
> BUFFERED batch,
> //so you don't have to worry about it as a DEV?
> //  - NUMERIC bound of 10 refers to NUMBER of elements (of possibly 
> complex types) on a
> //UNIFORM-ELEMENT-TYPED stream, rather than Bytes, right?
> //  - if source produces N < BUFFER_MAX elements; then those are 
> simply passed through the pipeline without
> //waiting to accumulate BUFFER_MAX elements
> //
>
>
> inputSource.buffer(10, OverflowStrategy.dropHead) ~> f1 ~> ...
>
>

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.