[akka-user] Re: Kryo serialization not working?

2016-09-08 Thread Federico Nusymowicz
DERP. I was supposed to nest serializers and serialization-bindings under 
akka.actor ^_^;

On Thursday, September 8, 2016 at 3:24:56 PM UTC-7, Federico Nusymowicz 
wrote:
>
> I've been trying to set up kryo serialization, without success. Here's my 
> first attempt:
>
> akka {
>>   ...
>>
>>   extensions = [
>> "akka.cluster.pubsub.DistributedPubSub",
>> "com.romix.akka.serialization.kryo.KryoSerializationExtension$"
>>   ]
>>
>>   actor {
>> ...
>>
>> kryo {
>>   type = "graph"
>>   idstrategy = "automatic"
>>   buffer-size = 4096
>>   max-buffer-size = -1
>>   use-manifests = false
>>   post-serialization-transformations = "lz4"
>>   kryo-trace = false
>>   implicit-registration-logging = true
>>
>>   mappings {
>> "life.vw.client.ConciergeTracker$StatusUpdate" = 30,
>> "life.vw.client.Connection$Write" = 31
>>   }
>> }
>>   }
>>
>>   serializers {
>> kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
>>   }
>>
>>   serialization-bindings {
>> "life.vw.client.ConciergeTracker$StatusUpdate" = kryo
>> "life.vw.client.Connection$Write" = kryo
>>   }
>>
>>   ...
>> }
>>
>>
>  When I ran the cluster, I kept seeing serialization warnings:
>
> WARN  17:42:27.913UTC akka.serialization.Serialization(akka://vw) - Using the 
> default Java serializer for class 
> [life.vw.client.ConciergeTracker$StatusUpdate] which is not recommended 
> because of performance implications. Use another serializer or disable this 
> warning using the setting 'akka.actor.warn-about-java-serializer-usage'
>
>
> I've tried a few other variations, including different values for 
> "idstrategy", class names that only use "." (in place of "$"), and 
> subclassing my messages under a shared trait. None of the attempts worked.
>
> I even tried replacing akka-kryo-serialization with Twitter's chill. Even 
> though I followed setup instructions in detail, I kept seeing serialization 
> warnings.
>
> Am I missing something obvious? Is there additional setup required when 
> using serialization together with DistributedPubSub?
>
> Thanks in advance for your help!
>
> Federico
>

-- 
>>  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] Kryo serialization not working?

2016-09-08 Thread Federico Nusymowicz
I've been trying to set up kryo serialization, without success. Here's my 
first attempt:

akka {
>   ...
>
>   extensions = [
> "akka.cluster.pubsub.DistributedPubSub",
> "com.romix.akka.serialization.kryo.KryoSerializationExtension$"
>   ]
>
>   actor {
> ...
>
> kryo {
>   type = "graph"
>   idstrategy = "automatic"
>   buffer-size = 4096
>   max-buffer-size = -1
>   use-manifests = false
>   post-serialization-transformations = "lz4"
>   kryo-trace = false
>   implicit-registration-logging = true
>
>   mappings {
> "life.vw.client.ConciergeTracker$StatusUpdate" = 30,
> "life.vw.client.Connection$Write" = 31
>   }
> }
>   }
>
>   serializers {
> kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
>   }
>
>   serialization-bindings {
> "life.vw.client.ConciergeTracker$StatusUpdate" = kryo
> "life.vw.client.Connection$Write" = kryo
>   }
>
>   ...
> }
>
>
 When I ran the cluster, I kept seeing serialization warnings:

WARN  17:42:27.913UTC akka.serialization.Serialization(akka://vw) - Using the 
default Java serializer for class 
[life.vw.client.ConciergeTracker$StatusUpdate] which is not recommended because 
of performance implications. Use another serializer or disable this warning 
using the setting 'akka.actor.warn-about-java-serializer-usage'


I've tried a few other variations, including different values for 
"idstrategy", class names that only use "." (in place of "$"), and 
subclassing my messages under a shared trait. None of the attempts worked.

I even tried replacing akka-kryo-serialization with Twitter's chill. Even 
though I followed setup instructions in detail, I kept seeing serialization 
warnings.

Am I missing something obvious? Is there additional setup required when 
using serialization together with DistributedPubSub?

Thanks in advance for your help!

Federico

-- 
>>  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] Re: Suddenly increasing inter-actor message delivery time

2016-09-08 Thread Patrik Nordwall
If it's cpu bound work I would recommend one dispatcher for all with
slightly less threads than cores. Set max to cores - 1. Too many threads
will just make things slower for cpu bound work.

The reason for not using all cores is that it can be good to have some
spare capacity for other manegement tasks. You have to experiment with what
is best for your system.

/Patrik
tors 8 sep. 2016 kl. 21:10 skrev Rob Crawford :

> Kamon (kamon.io) has some of those metrics.
>
> http://kamon.io/integrations/akka/actor-router-and-dispatcher-metrics/
>
> Can you reproduce the problem easily? If so, try it with a
> Kamon-instrumented build and see what you get.
>
>
> On Thursday, September 8, 2016 at 12:41:00 PM UTC-4, Alexey Shuksto wrote:
>>
>> Hello hAkkers!
>>
>> We've got some very strange message delivery time pattern between actors:
>>
>> We have system with ~2000 type "A" working actors, each of whom have 1 to
>> 50 type "B" sub-workers (who do actual work, but do it very fast -- >1ms
>> between request and response).
>>
>> Every type A actor every second receives 1 to 50 (equal to number of
>> sub-workers) payloads of 1 to 10 messages (1 to 500 messages total),
>> chooses one type B actor per payload (1 to 10 messages), forwards them and
>> interpreting B-actor result.
>>
>> Number of "in-payload" messages is dependent of 'second-per-minute' --
>> most messages are received in 29th and 59th seconds.
>>
>> Usually a total time of message processing is around 1 to 5ms for a full
>> circle: in -> A -> B -> A -> out.
>> But in the "high load" times processing time quickly escalates up to 2.5
>> _seconds_.
>>
>> After some investigation and providing of separate dispatchers for type A
>> (FJE, parallelism 8 min, 64 max, 3.0 factor) and type B (same
>> configuration) actors, we were able to determine that type A actor still
>> receive messages at very fast rate, but type B actors...
>> At the start of processing they receive payload almost momentarily (0 to
>> 1ms latency), but as processing continues, time to deliver message from A
>> to B starts increasing up to 2.5 seconds mentioned above.
>>
>> We tried to tweak type B dispatcher and set 
>> SingleConsumerOnlyUnboundedMailbox
>> for them to no effect at all.
>>
>> From hardware side we have dual 6 core Intel server class processors (24
>> cores total), JVM has 32GB of ram (no swapping), G1GC, gc pauses do not
>> exceed 100ms and happens usually every 10-15 seconds.
>>
>> Is there anything else that we can tweak or use to pinpoint the problem?
>> May be some metric for average actor queue size and per-actor dispatcher
>> time?
>>
> --
> >> 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] akka-streams redis client suggestions

2016-09-08 Thread Christian Schmitt
Hello I wanted to grab some suggestions on what could be made better in the 
early implementation of my simple redis client on to of akka-streams.

The code is here: https://github.com/envisia/play-cache-backport
everything akka-streams related is 
here: 
https://github.com/envisia/play-cache-backport/tree/master/play-cache-redis/src/main/scala/de/envisia/envisia/redis/internal

Actually it's quite early (like 2-3 hours work) but I wanted to stabilize 
it a bit and maybe implement the message types correctly via a 
decoder/encoder.

I'm also not exactly sure how a reconnect could work with that. Probably 
need to check what happens on failure and then screw the whole 
RedisConnection

-- 
>>  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: Suddenly increasing inter-actor message delivery time

2016-09-08 Thread Rob Crawford
Kamon (kamon.io) has some of those metrics.

http://kamon.io/integrations/akka/actor-router-and-dispatcher-metrics/

Can you reproduce the problem easily? If so, try it with a 
Kamon-instrumented build and see what you get. 

On Thursday, September 8, 2016 at 12:41:00 PM UTC-4, Alexey Shuksto wrote:
>
> Hello hAkkers!
>
> We've got some very strange message delivery time pattern between actors:
>
> We have system with ~2000 type "A" working actors, each of whom have 1 to 
> 50 type "B" sub-workers (who do actual work, but do it very fast -- >1ms 
> between request and response).
>
> Every type A actor every second receives 1 to 50 (equal to number of 
> sub-workers) payloads of 1 to 10 messages (1 to 500 messages total), 
> chooses one type B actor per payload (1 to 10 messages), forwards them and 
> interpreting B-actor result.
>
> Number of "in-payload" messages is dependent of 'second-per-minute' -- 
> most messages are received in 29th and 59th seconds.
>
> Usually a total time of message processing is around 1 to 5ms for a full 
> circle: in -> A -> B -> A -> out.
> But in the "high load" times processing time quickly escalates up to 2.5 
> _seconds_.
>
> After some investigation and providing of separate dispatchers for type A 
> (FJE, parallelism 8 min, 64 max, 3.0 factor) and type B (same 
> configuration) actors, we were able to determine that type A actor still 
> receive messages at very fast rate, but type B actors...
> At the start of processing they receive payload almost momentarily (0 to 
> 1ms latency), but as processing continues, time to deliver message from A 
> to B starts increasing up to 2.5 seconds mentioned above.
>
> We tried to tweak type B dispatcher and set 
> SingleConsumerOnlyUnboundedMailbox 
> for them to no effect at all.
>
> From hardware side we have dual 6 core Intel server class processors (24 
> cores total), JVM has 32GB of ram (no swapping), G1GC, gc pauses do not 
> exceed 100ms and happens usually every 10-15 seconds.
>
> Is there anything else that we can tweak or use to pinpoint the problem? 
> May be some metric for average actor queue size and per-actor dispatcher 
> time?
>

-- 
>>  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] Suddenly increasing inter-actor message delivery time

2016-09-08 Thread Алексей Шуксто
2.4.10.
Чт, 8 сент. 2016 г. в 19:49, Viktor Klang :

> Version?
>
> On Thu, Sep 8, 2016 at 6:41 PM, Alexey Shuksto  wrote:
>
>> Hello hAkkers!
>>
>> We've got some very strange message delivery time pattern between actors:
>>
>> We have system with ~2000 type "A" working actors, each of whom have 1 to
>> 50 type "B" sub-workers (who do actual work, but do it very fast -- >1ms
>> between request and response).
>>
>> Every type A actor every second receives 1 to 50 (equal to number of
>> sub-workers) payloads of 1 to 10 messages (1 to 500 messages total),
>> chooses one type B actor per payload (1 to 10 messages), forwards them and
>> interpreting B-actor result.
>>
>> Number of "in-payload" messages is dependent of 'second-per-minute' --
>> most messages are received in 29th and 59th seconds.
>>
>> Usually a total time of message processing is around 1 to 5ms for a full
>> circle: in -> A -> B -> A -> out.
>> But in the "high load" times processing time quickly escalates up to 2.5
>> _seconds_.
>>
>> After some investigation and providing of separate dispatchers for type A
>> (FJE, parallelism 8 min, 64 max, 3.0 factor) and type B (same
>> configuration) actors, we were able to determine that type A actor still
>> receive messages at very fast rate, but type B actors...
>> At the start of processing they receive payload almost momentarily (0 to
>> 1ms latency), but as processing continues, time to deliver message from A
>> to B starts increasing up to 2.5 seconds mentioned above.
>>
>> We tried to tweak type B dispatcher and set 
>> SingleConsumerOnlyUnboundedMailbox
>> for them to no effect at all.
>>
>> From hardware side we have dual 6 core Intel server class processors (24
>> cores total), JVM has 32GB of ram (no swapping), G1GC, gc pauses do not
>> exceed 100ms and happens usually every 10-15 seconds.
>>
>> Is there anything else that we can tweak or use to pinpoint the problem?
>> May be some metric for average actor queue size and per-actor dispatcher
>> time?
>>
> --
>> >> 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.
>>
>
>
>
> --
> Cheers,
> √
>
> --
> >> 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/baZ8uatd3IA/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


Re: [akka-user] Suddenly increasing inter-actor message delivery time

2016-09-08 Thread Viktor Klang
Version?

On Thu, Sep 8, 2016 at 6:41 PM, Alexey Shuksto  wrote:

> Hello hAkkers!
>
> We've got some very strange message delivery time pattern between actors:
>
> We have system with ~2000 type "A" working actors, each of whom have 1 to
> 50 type "B" sub-workers (who do actual work, but do it very fast -- >1ms
> between request and response).
>
> Every type A actor every second receives 1 to 50 (equal to number of
> sub-workers) payloads of 1 to 10 messages (1 to 500 messages total),
> chooses one type B actor per payload (1 to 10 messages), forwards them and
> interpreting B-actor result.
>
> Number of "in-payload" messages is dependent of 'second-per-minute' --
> most messages are received in 29th and 59th seconds.
>
> Usually a total time of message processing is around 1 to 5ms for a full
> circle: in -> A -> B -> A -> out.
> But in the "high load" times processing time quickly escalates up to 2.5
> _seconds_.
>
> After some investigation and providing of separate dispatchers for type A
> (FJE, parallelism 8 min, 64 max, 3.0 factor) and type B (same
> configuration) actors, we were able to determine that type A actor still
> receive messages at very fast rate, but type B actors...
> At the start of processing they receive payload almost momentarily (0 to
> 1ms latency), but as processing continues, time to deliver message from A
> to B starts increasing up to 2.5 seconds mentioned above.
>
> We tried to tweak type B dispatcher and set SingleConsumerOnlyUnboundedMailbox
> for them to no effect at all.
>
> From hardware side we have dual 6 core Intel server class processors (24
> cores total), JVM has 32GB of ram (no swapping), G1GC, gc pauses do not
> exceed 100ms and happens usually every 10-15 seconds.
>
> Is there anything else that we can tweak or use to pinpoint the problem?
> May be some metric for average actor queue size and per-actor dispatcher
> time?
>
> --
> >> 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.
>



-- 
Cheers,
√

-- 
>>  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] Suddenly increasing inter-actor message delivery time

2016-09-08 Thread Alexey Shuksto
Hello hAkkers!

We've got some very strange message delivery time pattern between actors:

We have system with ~2000 type "A" working actors, each of whom have 1 to 
50 type "B" sub-workers (who do actual work, but do it very fast -- >1ms 
between request and response).

Every type A actor every second receives 1 to 50 (equal to number of 
sub-workers) payloads of 1 to 10 messages (1 to 500 messages total), 
chooses one type B actor per payload (1 to 10 messages), forwards them and 
interpreting B-actor result.

Number of "in-payload" messages is dependent of 'second-per-minute' -- most 
messages are received in 29th and 59th seconds.

Usually a total time of message processing is around 1 to 5ms for a full 
circle: in -> A -> B -> A -> out.
But in the "high load" times processing time quickly escalates up to 2.5 
_seconds_.

After some investigation and providing of separate dispatchers for type A 
(FJE, parallelism 8 min, 64 max, 3.0 factor) and type B (same 
configuration) actors, we were able to determine that type A actor still 
receive messages at very fast rate, but type B actors...
At the start of processing they receive payload almost momentarily (0 to 
1ms latency), but as processing continues, time to deliver message from A 
to B starts increasing up to 2.5 seconds mentioned above.

We tried to tweak type B dispatcher and set SingleConsumerOnlyUnboundedMailbox 
for them to no effect at all.

>From hardware side we have dual 6 core Intel server class processors (24 
cores total), JVM has 32GB of ram (no swapping), G1GC, gc pauses do not 
exceed 100ms and happens usually every 10-15 seconds.

Is there anything else that we can tweak or use to pinpoint the problem? 
May be some metric for average actor queue size and per-actor dispatcher 
time?

-- 
>>  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] Router Configuration from external Config

2016-09-08 Thread Alex Soto
OK great then; I am already doing it at the Actor System level.
Thanks

On Thursday, September 8, 2016 at 11:31:22 AM UTC-4, √ wrote:
>
> Hi Alex,
>
> FromConfig uses the config associated with the ActorSystem. See the 
> ActorSystem scaladoc/javadoc for how to specify configuration 
> programmatically.
>
> On Thu, Sep 8, 2016 at 5:19 PM, Alex Soto  > wrote:
>
>> Hello,
>>
>> Is it possible to configure a Router from a configuration loaded from 
>> external sources? 
>> I am using *FromConfig.getInstance()*  but this uses the 
>> *application.conf* file and I want to provide my own Config object I 
>> loaded from somewhere else.
>>
>> I use Java and Akka version 2.4.2.
>>
>> Thanks,
>> Alex Soto
>>
>> -- 
>> >> 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.
>>
>
>
>
> -- 
> Cheers,
> √
>

-- 
>>  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] Router Configuration from external Config

2016-09-08 Thread Viktor Klang
Hi Alex,

FromConfig uses the config associated with the ActorSystem. See the
ActorSystem scaladoc/javadoc for how to specify configuration
programmatically.

On Thu, Sep 8, 2016 at 5:19 PM, Alex Soto  wrote:

> Hello,
>
> Is it possible to configure a Router from a configuration loaded from
> external sources?
> I am using *FromConfig.getInstance()*  but this uses the
> *application.conf* file and I want to provide my own Config object I
> loaded from somewhere else.
>
> I use Java and Akka version 2.4.2.
>
> Thanks,
> Alex Soto
>
> --
> >> 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.
>



-- 
Cheers,
√

-- 
>>  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] Router Configuration from external Config

2016-09-08 Thread Alex Soto
Hello,

Is it possible to configure a Router from a configuration loaded from 
external sources? 
I am using *FromConfig.getInstance()*  but this uses the *application.conf* 
file and I want to provide my own Config object I loaded from somewhere 
else.

I use Java and Akka version 2.4.2.

Thanks,
Alex Soto

-- 
>>  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] akka serialization - message boundary

2016-09-08 Thread Wei
Thanks. I am looking into that lib.

On Wednesday, September 7, 2016 at 4:22:44 AM UTC-4, Guido Medina wrote:
>
> Hi,
>
> You can also try Akka Kryo serialization extension, it has proven to be 
> very efficient so far so you don't have to write your own serialization.
> Kryo offers you automatic, manual (by you listing explicitly) registration 
> of the classes and both.
>
> It is a very matured extension and its backed by Kryo itself which has a 
> good support.
> You can still use Json (using Jackson or for simpler Json you can use 
> Vert.x core Json which wraps a Jackson Json) + Kryo if you want to have 
> some schema evolution and not deal with class versions.
>
> https://github.com/romix/akka-kryo-serialization
>
> HTH,
>
> Guido.
>

-- 
>>  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] GPU computing with akka

2016-09-08 Thread Akka Team
Hi Zhaoije,

No we are not working on anything like that, and the project mentioned does
not seem to have been touched in the last 5 years.

If there are JVM libraries that can do GPU processing there is nothing
stopping you from using it from actors/Akka though.

--
Johan
Akka Team

On Thu, Sep 8, 2016 at 8:23 AM, Zhaojie Niu  wrote:

> Hi Guys:
>
> Are you still working on the GPU support for Akka?
>
> I think it will be very useful if Akka can support GPU computing now. We
> can see how hot the deep learning is recently and it also shows that GPU
> indeed outperforms CPU in terms of these kind of simple but massive
> computing for the SGD-like algorithms which are widely used.
>
> I am very interested in this project. Do you have any updates on this kind
> of project (e.g., https://github.com/buka/kula)?
> I plan to explore this direction and try to develop a prototype based on
> this project even it seems that nobody maintain it for a long time -_-.
>
> 在 2011年8月24日星期三 UTC+8下午4:37:51,Jonas Bonér写道:
>>
>>  That sounds very cool. I'm really interested to see what comes out of
>> this. I hope you get the time to complete it
>>
>> On Aug 24, 2011, at 7:11 AM, Garrick Evans wrote:
>>
>> A long time ago we had this discussion and it was rattling around in my
>> head on and off ever since.  I was able to scratch together a few nights
>> and mornings recently and start something.  Anyway, I have no idea if I'll
>> be able to give this dedicated attention but figured I'd share it in the
>> event there was interest... It definitely falls in the quick and dirty
>> category - browse and your own risk.
>>
>> https://github.com/buka/kula
>>
>> g
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> g/akka-user/-/oymjbjtDS6kJ.
>> To post to this group, send email to akka...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> akka-user+...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group
>> /akka-user?hl=en.
>>
>>
>> 
>> Jonas Bonér
>> CTO
>> Typesafe - Enterprise-Grade Scala from the Experts
>> Phone: +46 733 777 123
>> Twitter: @jboner
>>
>> --
> >> 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 Team
Lightbend  - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>  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] Example of stateful BidiFlow

2016-09-08 Thread Yaroslav Klymko
Thanks a lot!

I've started to think that I'm moving to the wrong direction.

On Thursday, September 8, 2016 at 5:00:22 PM UTC+3, Akka Team wrote:
>
> Hi Yaroslav,
>
> You mean a stateful GraphStage with BidiShape? 
> I don't think we have any in the docs, but there are at least one in the 
> HTTP sources to look at, this one:
>
> https://github.com/akka/akka/blob/fbfc8b4c58ecc8820e06d68114e7d41f82c3de32/akka-http-core/src/main/scala/akka/http/impl/util/One2OneBidiFlow.scala
>
> --
> Johan
> Akka Team
>
> On Wed, Sep 7, 2016 at 2:26 PM, Yaroslav Klymko  > wrote:
>
>> Hi Guys,
>> Is there somewhere an example of stateful BidiFlow ?
>>
>> -- 
>> >> 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.
>>
>
>
>
> -- 
> Akka Team
> Lightbend  - Reactive apps on the JVM
> Twitter: @akkateam
>

-- 
>>  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] Example of stateful BidiFlow

2016-09-08 Thread Akka Team
Hi Yaroslav,

You mean a stateful GraphStage with BidiShape?
I don't think we have any in the docs, but there are at least one in the
HTTP sources to look at, this one:
https://github.com/akka/akka/blob/fbfc8b4c58ecc8820e06d68114e7d41f82c3de32/akka-http-core/src/main/scala/akka/http/impl/util/One2OneBidiFlow.scala

--
Johan
Akka Team

On Wed, Sep 7, 2016 at 2:26 PM, Yaroslav Klymko  wrote:

> Hi Guys,
> Is there somewhere an example of stateful BidiFlow ?
>
> --
> >> 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 Team
Lightbend  - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>  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] akka-http how to allow idle connections while limiting the total number of responses being rendered

2016-09-08 Thread Akka Team
Hi Raghav,

You cannot achieve this with the built in tools, but a simple custom
directive will do the trick. Something like this:

def createConcurrentLimiter(maxConcurrent: Int): Directive0 = {
  // thread safe counter for connections
  val concurrent = new AtomicInteger(0)

  pass.tflatMap[Unit] { _ =>
if (concurrent.get() >= maxConcurrent) {
  complete(StatusCodes.ServiceUnavailable)
} else {
  concurrent.incrementAndGet()
  mapResponse { response =>
concurrent.getAndDecrement()
response
  }
}
  }
}

// important to create once and reuse, so that the same atomic int is used
val maxOneConcurrent = createConcurrentLimiter(1)

val route = get {
  extractRequest { req =>
maxOneConcurrent {
  // never more than one in here
  complete("ok")
}
  }
}


--
Johan
Akka Team

On Mon, Sep 5, 2016 at 3:56 PM, 'Raghav Narula' via Akka User List <
akka-user@googlegroups.com> wrote:

> I'm using akka-http to build one of my services which returns a chunked
> response that could be 10s of MBs big depending on the client's query. I've
> noticed that the memory required is proportional to the number of
> concurrent streams rather than the number of connections from clients, as
> idle connections seem to use hardly any resources at all.
>
> Is there any way to limit the number of responses being rendered? I can
> only see the akka.http.server.max-connections config variable which seems
> to limit the total number of connections, rather than in flight responses.
> With a low max-connections value clients could be denied service because of
> idle clients holding connections. With a high max-connections I get out of
> memory errors as there is potential for all the connections to make large
> requests.
>
> Ideally I'd like to be able to keep connections open so that clients can
> avoid the overhead of making new connections, but still limit the number of
> in flight responses to protect memory usage. Then if the client tries to
> make a request which can't be served, the connection is dropped with a 409
> maybe?
>
> Or is the common way to deal with this to just have a fast timeout so
> clients can't hold open connections for too long, and make them re-open
> connections frequently?
>
> --
> >> 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 Team
Lightbend  - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>  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] Re: How to Test WebSocket Streams

2016-09-08 Thread Akka Team
Hi Dagny,

The dependency you need is akka-http-testkit, so in sbt an entry like
this: "com.typesafe.akka"
%% "akka-http-testkit" % akkaV % "test"
It also depends on scalatest, we use version 2.2.1 and I see you have put a
dependency on a snapshot of Scalatest 3, this may cause some problems, you
should notice those as it probably wont compile if there is an
incompability.

The complete example file used in the docs can be found here, and should
help you see what imports are needed:
https://github.com/akka/akka/blob/4acc1cca6a27be0ff80f801de3640f91343dce94/akka-docs/rst/scala/code/docs/http/scaladsl/server/directives/WebSocketDirectivesExamplesSpec.scala

--
Johan
Akka Team

On Wed, Aug 31, 2016 at 10:32 PM, Dagny T  wrote:

>
> TYPO!  My latest WebSocketServer experiment is ACTUALLY in:
> - streamsWebSocket.scala
>
>
> On Wednesday, August 31, 2016 at 1:23:36 PM UTC-7, Dagny T wrote:
>>
>> Newbie Testing WebSocket on Stream.
>>
>> Needed to verify I'm following best-practices on the basics for this!
>>
>> Please refer to my Repo:
>> https://github.com/DagnyTagg2013/ScalaReactive/tree/master/newbie
>>
>> 1) Tried initiating Web Socket Connection JS Client: basicWebSockets.js
>> then handling it on an Akka Streams Server with an Http Request Handler:
>> firstWebSocketServer.scala
>>
>> 2) Tried to test Server with Akka TestKit; but missing build.sbt
>> dependencies for WS(...) and RoutingSpec(...)
>> - Test code here: testWebSocketServer2.scala
>> - Dependencies here:  build.sbt
>>
>> If someone could please comment on how to:
>> - successfully get a WebSocket connection from (1) -- am I setting up the
>> JS and Scala connection correctly?
>> - successfully get the test dependencies to build from (2) -- am I using
>> the correct version of Akka Test libraries to work the the code in
>> testWebSocketServer2?
>>
>> THANKS a lot!
>> D
>>
>> --
> >> 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 Team
Lightbend  - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>  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] Exception during creation of ActorReceiver in Spark CDH 5.5.2

2016-09-08 Thread Akka Team
Hi Rick,

The error message hints about providing an incorrect list of
parameters: constructor
public akka.actor.CreatorFunctionConsumer(scala.Function0) is incompatible
with arguments [class java.lang.Class, class org.apache.spark.examples.
streaming.ActorWordCount$$anonfun$2]

Note the second parameter being a specific lambda expression, so something
about serializing lambdas.

The chances of getting a good answer may be better in a more Spark focused
forum (see here: https://spark.apache.org/community.html)

--
Johan
Akka Team

On Wed, Aug 31, 2016 at 12:56 AM, Ricky  wrote:

> I'm running Spark on CDH 5.5.2 which has a dependency on Akka 2.2.3.
>
> I'm attempting to create an actorStream in Spark, but during the creation
> of the actor I get the following exception.
>
> Caused by: java.lang.IllegalArgumentException: constructor public 
> akka.actor.CreatorFunctionConsumer(scala.Function0) is incompatible with 
> arguments [class java.lang.Class, class 
> org.apache.spark.examples.streaming.ActorWordCount$$anonfun$2] at 
> akka.util.Reflect$.instantiate(Reflect.scala:69)
>
> Which traces back to 
> https://github.com/akka/akka/blob/v2.2.3/akka-actor/src/main/scala/akka/actor/Props.scala#L337.
>
> Below is a code snippet of my code.
>
> class SampleActorReceiver(url: String) extends Actor with ActorHelper {
>
>   lazy private val remotePublisher = context.actorSelection(url)
>
>   override def preStart() {
> remotePublisher ! SubscribeReceiver(context.self)
>   }
>
>   def receive = {
>  case msg => store(msg.asInstanceOf[String])
>}
> }
>
>
> object ActorStreaming extends App {
>
> val system = ActorSystem("ActorStreaming")
> val feederRef = system.actorOf(Props[FeederActor], "FeederActor")
>
> val sparkConf = new SparkConf().setAppName("Actor Streaming")
> val ssc = new StreamingContext(sparkConf, Seconds(2))
>
> val url = feederRef.path.toStringWithAddress(Address("akka.tcp",
> system.name, InetAddress.getLocalHost.getHostAddress, 2552))
>
> val props = Props.create(classOf[SampleActorReceiver], url)
>
> val lines = ssc.actorStream[String](props, "SampleReceiver")
>
> lines.flatMap(_.split("\\s+")).map(x => (x,1)).reduceByKey( _ +
> _).print()
>
> ssc.start()
> ssc.awaitTermination()
>
> system.awaitTermination()
>
> }
>
> There appears to be an issue with the Creator function being improperly
> serialized when spark sends the function from the driver to the receiver.
> Are there any workarounds, or is there something wrong with my code. Btw it
> works if I run it locally using spark submit, but fails if I submit it on
> the CDH cluster.
>
> 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 Team
Lightbend  - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>  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] Cannot configure mailbox for Routees in RoundRobinPool

2016-09-08 Thread Akka Team
Hi Mehmet,

Easiest would be to select the mailbox with props:

system.actorOf(Props[TestActor]
  .withMailbox("bounded-mailbox") // here
  .withRouter(FromConfig),
  "groupedtestactor")

But you could also do it purely from config with a deployment section like
this:

"/groupedtestactor/*" {
  mailbox = bounded-mailbox
}

Since the pool will create the routees as children this configures all
direct children of the router to use the bounded-mailbox

--
Johan
Akka Team


On Fri, Aug 26, 2016 at 2:53 PM, Mehmet Cem Güntürkün <
mehmetcemguntur...@gmail.com> wrote:

>
> Hello everyone,
>
> When I try to set a bounded mailbox to routees of RoundRobinPool, Akka,
> kind of ignores the configuration parameter.
>
>
> Here is the sample for configuration:
>
>
> bounded-mailbox {
>   mailbox-type = "akka.dispatch.BoundedMailbox"
>   mailbox-capacity = 1
>   mailbox-push-timeout-time = 1s
> }
>
> akka.actor.deployment {
>   /singletestactor {
> mailbox = bounded-mailbox
>   }
>
>   /groupedtestactor {
> mailbox = bounded-mailbox
>
> router = round-robin-pool
> nr-of-instances = 5
>   }
> }
>
>
> and Here is the test code:
>
>
> object MailboxTest {
>   def main(args: Array[String]): Unit = {
> val actorSystem = ActorSystem()
> val singleTestActor = actorSystem.actorOf(Props[TestActor],
> "singletestactor")
> for (i <- 1 to 10) {
>   singleTestActor ! Hello(i)
> }
>
>
> val groupedTestActor = actorSystem.actorOf(Props[
> TestActor].withRouter(FromConfig, "groupedtestactor")
> for (i <- 1 to 1000) {
>   groupedTestActor ! Hello(i)
> }
>   }
> }
>
> class TestActor extends Actor {
>   def receive = {
> case Hello(i) => {
>   println(s"Hello($i) - begin!")
>   Thread.sleep(1)
>   println(s"Hello($i) - end!")
> }
>   }
> }
>
> case class Hello(i: Int)
>
>
>
> Am I doing something wrong or there is no way to do that?
> Mehmet -
>
> --
> >> 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 Team
Lightbend  - Reactive apps on the JVM
Twitter: @akkateam

-- 
>>  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] [akka-http] what is actually happening on request timeout?

2016-09-08 Thread Akka Team
Hi Kyrlyo,

The flow will be cancelled as the downstream is already completed.

I find this little stage may be useful to help you reason about what is
going on, you should be able to verify that it prints "onDownstreamFinish"
when the route times out:

case class SnitchingStage[A](name: String) extends GraphStage[FlowShape[A, A]] {
  val in = Inlet[A]("in")
  val out = Outlet[A]("out")
  override val shape: FlowShape[A, A] = FlowShape(in, out)
  override def createLogic(inheritedAttributes: Attributes):
GraphStageLogic = new GraphStageLogic(shape) {
setHandler(in, new InHandler {
  override def onPush(): Unit = {
println(s"$name: onPush")
push(out, grab(in))
  }
  override def onUpstreamFinish(): Unit = {
println(s"$name: onUpstreamFinish")
super.onUpstreamFinish()
  }
  override def onUpstreamFailure(ex: Throwable): Unit = {
println(s"$name: onUpstreamFailure: ${ex.getMessage}")
super.onUpstreamFailure(ex)
  }
})
setHandler(out, new OutHandler {
  override def onPull(): Unit = {
println(s"$name: onPull")
pull(in)
  }
  override def onDownstreamFinish(): Unit = {
println(s"$name: onDownstreamFinish")
super.onDownstreamFinish()
  }
})
  }
}


--
Johan
Akka Team

On Sat, Aug 27, 2016 at 10:25 PM, Kyrylo Stokoz  wrote:

> HI All,
>
> I came across a strange issue happening with akka http on request timeout
> which i cannot understand, can some body help me with it?
>
> Consider following code in akka 2.4.9:
>
>
> import akka.NotUsed
> import akka.actor.ActorSystem
> import akka.http.scaladsl.Http
> import akka.http.scaladsl.model.{HttpRequest, HttpResponse}
> import akka.http.scaladsl.server.Directives._
> import akka.stream.{ActorMaterializer, FlowShape}
> import akka.stream.scaladsl.GraphDSL.Implicits._
> import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Zip}
>
> import scala.concurrent.Future
>
> object Test extends App {
>   implicit val actorSystem = ActorSystem()
>   implicit val ec = actorSystem.dispatcher
>   implicit val materializer = ActorMaterializer()
>
>   def routes =
> (path("test1") & get) {
>   complete("result1")
> } ~
> (path("test2") & get) {
>   complete {
> Future {
>   Thread.sleep(3)
>   "result2"
> }
>   }
> }
>
>   def processRequest(route: Flow[HttpRequest, HttpResponse, NotUsed]): 
> Flow[HttpRequest, HttpResponse, NotUsed] =
> new ExtendedFlow(route).extend()
>
>   val serverSource = Http().bindAndHandle(processRequest(routes), "0.0.0.0", 
> port = 11011)
> }
>
> final class ExtendedFlow[A, B](originalFlow: Flow[A, B, NotUsed]) {
>
>   def extend(): Flow[A, B, NotUsed] =
> Flow.fromGraph {
>   GraphDSL.create() { implicit builder =>
>
> val in = builder.add(Flow[A].map { e => println("in " + e); e })
>
> val broadcast = builder.add(Broadcast[A](2))
> val zip   = builder.add(Zip[A, B]())
>
> val out = builder.add(Flow[(A, B)].map { o => println("out " + o); 
> o._2 })
>
> in ~> broadcast; broadcast.out(0) ~> zip.in0
>  broadcast.out(1) ~> originalFlow ~> zip.in1; zip.out 
> ~> out
>
> FlowShape(in.in, out.out)
>   }
> }
> }
>
>
> Now if i execute `curl -v "http://localhost:11011/test1"` i correctly see 
> 'in' and 'out' print statements in console and "result1" sent to user.
>
>
> My actual confusion is when i execute `curl -v 
> "http://localhost:11011/test2"`.
>
> In this case after 20s (default request timeout in akka http) 
> HttpServerBluePrint sends 503 back to user with a message that server was not 
> able to produce response in time.
>
> Later, in 30s, future completes as well, result of it i guess is ignored as 
> response from client was already handled.
>
> Question here is what actually happening to the extended flow in this 
> situation?
>
>
> I don`t see any output from sent from zip.out, though i see 'in' statement 
> printed for test2. Seeing this i would assume either:
>
> 1. Flow would stuck eventually or
>
> 2. Flow would produce wrong pairs in zip commit from next request elements.
>
>
> From my observations flow keeps working without any problems/exceptions and 
> produce correct pair in zip?
>
>
> Anyone can shed some light what is actually going on here?
>
>
> Regards,
>
> Kyrylo
>
>
>
>
> --
> >> Read the docs: http://akka.io/docs/
> >> Check the FAQ: http://doc.akka.io/docs/akka/c
> urrent/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

Re: [akka-user] Re: Akka-http websockets connection fails 95% of the time

2016-09-08 Thread ac2epsilon
Reporting: server side drops connection with timeout in 5 sec (on same 
host):

Code: 

  case TextMessage.Streamed(stream)  => {
val future = stream.limit(100).runFold("")(_ + _)
val txt = Await.result(future, 5 seconds).asInstanceOf[String]
process(txt)
  }   

Question: 

Does anybody in the world know in practice, how to collect this Source in 
reasonably convenient way?


>

-- 
>>  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] Any form of first-try / first-peek at Artery Akka remoting ?

2016-09-08 Thread Patrik Nordwall
and the announcement contains a quick getting started guide:
https://groups.google.com/d/msg/akka-user/JLbLrLh3vIg/twhLMRg7CQAJ
there will be a M4 tomorrow

On Thu, Sep 8, 2016 at 10:49 AM, Viktor Klang 
wrote:

> Also, little known fact: "ARTERY" is pronounced in the same way as the
> chorus in Metallica's "BATTERY"
>
> On Thu, Sep 8, 2016 at 10:31 AM, Konrad Malawski <
> konrad.malaw...@lightbend.com> wrote:
>
>> Yes we're working on it.
>> Yes there's releases, just use them ;-)
>>
>> See 2.4-ARTERY versions: http://search.maven.
>> org/#search%7Cgav%7C1%7Cg%3A%22com.typesafe.akka%22%20AND%20
>> a%3A%22akka-remote_2.11%22
>>
>> --
>> Konrad `ktoso` Malawski
>> Akka  @ Lightbend 
>>
>> On 8 September 2016 at 10:29:26, Muthukumaran Kothandaraman (
>> muthu.kmk2...@gmail.com) wrote:
>>
>> Hi,
>>
>> Is Artery still a work in progress or any snapshots are available for
>> trying out ?
>>
>> Regards
>> Muthu
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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/c
>> urrent/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.
>>
>
>
>
> --
> Cheers,
> √
>
> --
> >> 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.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend  -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>  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] Any form of first-try / first-peek at Artery Akka remoting ?

2016-09-08 Thread Viktor Klang
Also, little known fact: "ARTERY" is pronounced in the same way as the
chorus in Metallica's "BATTERY"

On Thu, Sep 8, 2016 at 10:31 AM, Konrad Malawski <
konrad.malaw...@lightbend.com> wrote:

> Yes we're working on it.
> Yes there's releases, just use them ;-)
>
> See 2.4-ARTERY versions: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%
> 22com.typesafe.akka%22%20AND%20a%3A%22akka-remote_2.11%22
>
> --
> Konrad `ktoso` Malawski
> Akka  @ Lightbend 
>
> On 8 September 2016 at 10:29:26, Muthukumaran Kothandaraman (
> muthu.kmk2...@gmail.com) wrote:
>
> Hi,
>
> Is Artery still a work in progress or any snapshots are available for
> trying out ?
>
> Regards
> Muthu
>
> --
> >> 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.
>



-- 
Cheers,
√

-- 
>>  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] Any form of first-try / first-peek at Artery Akka remoting ?

2016-09-08 Thread Konrad Malawski
Yes we're working on it.
Yes there's releases, just use them ;-)

See 2.4-ARTERY versions:
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.typesafe.akka%22%20AND%20a%3A%22akka-remote_2.11%22

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 8 September 2016 at 10:29:26, Muthukumaran Kothandaraman (
muthu.kmk2...@gmail.com) wrote:

Hi,

Is Artery still a work in progress or any snapshots are available for
trying out ?

Regards
Muthu

--
>> 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] Any form of first-try / first-peek at Artery Akka remoting ?

2016-09-08 Thread Muthukumaran Kothandaraman
Hi, 

Is Artery still a work in progress or any snapshots are available for 
trying out ?

Regards
Muthu

-- 
>>  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] Re: Are messages ordered in activator hello akka java8 tutorial?

2016-09-08 Thread Patrik Nordwall
On Thu, Sep 8, 2016 at 8:38 AM, Patrik Nordwall 
wrote:

>
>
> On Thu, Sep 8, 2016 at 12:42 AM,  wrote:
>
>> On Wednesday, September 7, 2016 at 3:16:57 PM UTC-7, Guido Medina wrote:
>>>
>>> By induction you can conclude that messages order is guaranteed when
>>> sending sequentially (in the same thread) by using the following assertions:
>>>
>>>- Messages sent to any local actor go immediately to their
>>>destination inbox hence order is preserved because of sequential 
>>> execution
>>>- JMM rule.
>>>- Messages that go from node A to node B will be sent in the same
>>>order as they arrive to node A remote dispatcher's inbox which for an 
>>> actor
>>>hosted at node A, the order of arrival is preserved (apply previous rule)
>>>- Messages that arrive to node B will be put in the remote
>>>dispatcher inbox in the same order they arrived, apply first two rules 
>>> and
>>>you that concludes in the messaging ordering rule - as for remote, 
>>> current
>>>remote implementation when sending from node A to B, it can only send
>>>synchronously hence, order is also preserved.
>>>
>>> The most complicated rule is the last one, but once order from node A to
>>> node B is preserved then you can conclude that order messages from actor A
>>> to actor B is also preserved regardless of their location.
>>>
>>
> The rules only apply when the destination actor is the same.
> Implementation of old and new remoting are different in this regard, but
> that is implementation details that doesn't change the original rule.
> The new remoting will support parallel outbound and inbound lanes that are
> selected based on hashing of the destination ActorRef.
>
>
>> This is my explanation with my own words, the documentation I think
>>> explains it using the Java Memory Model as a reflection.
>>>
>>> HTH,
>>>
>>> Guido.
>>>


>> Can't the data that makes up 2 messages arrive out of order when sent
>> over a network? So, node A might send them in the order it received them,
>> but the order in which the node received the messages could be different
>> from what was sent to node A.
>>
>
We are only using transports that preserve order. TCP and Aeron.


>
>> The cited documentation says:
>>
>> It is important to note that Akka’s guarantee applies to the order in
>>> which messages are enqueued into the recipient’s mailbox.
>>
>>
>> Does that refer to the order in which messages are sent by Akka instead
>> of enqueued for the receiver?
>>
>
> I think that is a disclaimer for when the mailbox itself is not preserving
> order, e.g. a priority queue.
>
>
>>
>>
>> --
>> >> Read the docs: http://akka.io/docs/
>> >> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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.
>>
>
>
>
> --
>
> Patrik Nordwall
> Akka Tech Lead
> Lightbend  -  Reactive apps on the JVM
> Twitter: @patriknw
>
>


-- 

Patrik Nordwall
Akka Tech Lead
Lightbend  -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>  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.