Re: [akka-user] Re: Akka and Streams Concurrency Fundamentals

2016-09-09 Thread Dagny Taggart
Hi Johan and Patrik,

Thanks very much for your responses; and I'm just getting back to this.

Here's a cheeky request:
* Any chance you guys could Blog and put Links to GitHub for "Newbie
Reference Implementations" for putting together focused learning code
samples for these kinds of fundamentals, and with samples of using your
Testkits?
* Otherwise, could you get someone who is good at teaching Newbies; publish
a coherent learning progression project with Manning on the latest and
greatest Streams-Microservices-Architecture techniques?

That kind of insight on project-build-approach is hard to put together for
a Newbie from even top-notch API documentation.
And, I certainly did want to express my gratitude for the excellent
searchable Akka 2.4.8 Documentation!

THANK YOU so much!
D


On Wed, Sep 7, 2016 at 5:00 AM, Akka Team  wrote:

> Hi Dagny,
>
> The Akka Streams tests for the built in stages could perhaps be useful to
> see various strategies for testing. You can find those sources here:
> https://github.com/akka/akka/tree/master/akka-stream-tests/
> src/test/scala/akka/stream/scaladsl
>
> --
> Johan
> Akka Team
>
> On Fri, Sep 2, 2016 at 8:08 PM, Dagny T  wrote:
>
>>
>> Yes, well; that link is rather generic, no?  ;0)
>>
>> What I (and likely the 19 other Viewers of this post) are looking for is
>> baseline-thorough coverage of test-cases to be aware of when testing Akka
>> Actor and Streams operations.
>> I'm a newbie, and I learn best through running idiomatic code examples
>> with test cases; hence my interest.
>>
>> I didn't find that in the docs; nor am I finding it in any of the Blogs
>> that I've been Googling around for.
>> That's why I'm asking for help with finding a current and reliable
>> information source.
>>
>> I found these specific docs do provide a scratch-the-surface start:
>> http://doc.akka.io/docs/akka/2.4.9/scala/stream/stream-testkit.html
>>
>> However, I'm looking for Tutorial-level code covering things like:
>> - testing backpressure operation with Bounded memory settings when
>> operating simple Graphs of Flows
>> - testing for connection drops, resend of duplicate message,  and Client
>> retries and wait-timeouts
>> - testing for system exception-handling occurring in a mid-Flow Stage.
>>
>> Would be darn grateful if you had any specific insights on where to find
>> such learning resources; and were willing to share them with this Forum!
>>
>> Thanks in advance for continuing to support a welcoming community for
>> Akka Newbs!  You'll make the World a Better Place with Akka Everywhere!  ;0)
>> Dagny T
>>
>>
>> On Thursday, September 1, 2016 at 2:43:46 PM UTC-7, Dagny T wrote:
>>>
>>>
>>> I'd like to find reliable and current information for learning this
>>> using v2.4.9.
>>>
>>> I've posted a reply to someone else's related message; but wanted to
>>> call Forum attention to please help refer us to a useful Blog or GitHub
>>> repo on this topic; AND
>>> using the latest and greatest TestKit tools!
>>>
>>> It's been rather hit-or-miss with Googling samples lately; as the APIs
>>> have been moving rapidly, and I'm still too new to pick out what's
>>> essentially most important!
>>>
>>> THANK you so much in advance for any Best-Practice info on these
>>> fundamentals!
>>>
>>> Here was my reply to that earlier related post:
>>> https://groups.google.com/forum/#!topic/akka-user/4k4nXVn-wWw
>>>
>>> THANKS in advance to hAKKArs!
>>>
>> --
>> >> 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.
>>
>
>
>
> --
> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/FN3690Il9Kw/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 

Re: [akka-user] Re: How to Test WebSocket Streams

2016-09-09 Thread Dagny Taggart
Hi!

Just getting back to this; and THANKS for the sbt dependencies info -- I'll
have to try that out.
It looks like I already had the http testkit; but you're using an
additional "test" specifier ...;
and then your ScalaTest note is helpful too.

Would be awesome for Scala/Akka to have the equivalent of Java's
"Jarfinder" website to lookup SBT Maven Artifacts by Classname!

Here's a cheeky request:
* Any chance you guys could Blog and put Links to GitHub for "Newbie
Reference Implementations" for putting together focused learning code
samples like this?
* Otherwise, could you get someone who is good at teaching Newbies; publish
a coherent learning progression project with Manning on the latest and
greatest Streams-Microservices-Architecture techniques?

Thanks so much again!
D







On Thu, Sep 8, 2016 at 6:03 AM, Akka Team  wrote:

> 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/4acc1cca6a27be0ff80f801de3640f
> 91343dce94/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/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.
>>
>
>
>
> --
> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/aC19F2J-QSY/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 

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread kraythe
They specify the config just like any other serializer, with the 
serialization bindings. They have no examples of how to do it via code. But 
I think I can run with this, thanks. 

On Friday, September 9, 2016 at 4:12:50 PM UTC-5, Justin du coeur wrote:
>
> On Fri, Sep 9, 2016 at 3:49 PM, kraythe  
> wrote:
>
>> I am using Akka-kryo by Roman Levenshtein 
>>  as recommended on the 
>> akka serialization page. I know all about Kryo and have used it many times 
>> before. I can integrate it with manual config and it works fine. Thats not 
>> my point. I want to configure the bindings programatically. 
>>
>
> Right -- and my point is that the romix library is dealing with 
> translating *its* config stuff to Kryo, so *somewhere* in there it must be 
> demonstrating how to set the bindings up programmatically.  I suspect if 
> you figure out how the bindings get used in the romix library, you'll have 
> your answer...
>

-- 
>>  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] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Justin du coeur
(Never mind -- I think I'm misinterpreting what you're trying to
accomplish...)

On Fri, Sep 9, 2016 at 5:12 PM, Justin du coeur  wrote:

> On Fri, Sep 9, 2016 at 3:49 PM, kraythe  wrote:
>
>> I am using Akka-kryo by Roman Levenshtein
>>  as recommended on the
>> akka serialization page. I know all about Kryo and have used it many times
>> before. I can integrate it with manual config and it works fine. Thats not
>> my point. I want to configure the bindings programatically.
>>
>
> Right -- and my point is that the romix library is dealing with
> translating *its* config stuff to Kryo, so *somewhere* in there it must be
> demonstrating how to set the bindings up programmatically.  I suspect if
> you figure out how the bindings get used in the romix library, you'll have
> your answer...
>

-- 
>>  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] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Justin du coeur
On Fri, Sep 9, 2016 at 3:49 PM, kraythe  wrote:

> I am using Akka-kryo by Roman Levenshtein
>  as recommended on the
> akka serialization page. I know all about Kryo and have used it many times
> before. I can integrate it with manual config and it works fine. Thats not
> my point. I want to configure the bindings programatically.
>

Right -- and my point is that the romix library is dealing with translating
*its* config stuff to Kryo, so *somewhere* in there it must be
demonstrating how to set the bindings up programmatically.  I suspect if
you figure out how the bindings get used in the romix library, you'll have
your answer...

-- 
>>  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] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Viktor Klang
use withFallback(ConfigFactory.load(cl))

-- 
Cheers,
√

On Sep 9, 2016 22:24, "kraythe"  wrote:

> Doh, didn't know that was there. Bah. Sorry but thanks. :)
>
>  Do I need to worry about defining any bindings for Akka types such as
> com.google.protobuf.Message or can I safely ignore those without causing
> problems. ?
>
> On Friday, September 9, 2016 at 3:11:22 PM UTC-5, Konrad Malawski wrote:
>>
>> parseMap +1
>>
>> --
>> Konrad `ktoso` Malawski
>> Akka  @ Lightbend 
>>
>> On 9 September 2016 at 22:10:33, Viktor Klang (viktor...@gmail.com)
>> wrote:
>>
>> ConfigFactory.parseMap?
>>
>> --
>> Cheers,
>> √
>>
>> On Sep 9, 2016 22:01, "kraythe"  wrote:
>>
>>> Yeah, that much I know. However, I have a map of Class -> id in code and
>>> I want to create serialization bindings to this serializer for each of the
>>> types in that map's key set and assign type ids based on the map. What I am
>>> trying to do is figure out how to create the ConfigValue object
>>> programmatically to accomplish that.
>>>
>>> Thanks.
>>>
>>> On Friday, September 9, 2016 at 2:55:32 PM UTC-5, √ wrote:

 The ActorSystem takes an optional Config when created[1], create that
 Config object programmatically and do 
 withFallback(ConfigFactory.load(classloader))



 [1]: https://github.com/akka/akka/blob/master/akka-actor/src
 /main/scala/akka/actor/ActorSystem.scala#L141

 On Fri, Sep 9, 2016 at 9:49 PM, kraythe  wrote:

> I am using Akka-kryo by Roman Levenshtein
>  as recommended on
> the akka serialization page. I know all about Kryo and have used it many
> times before. I can integrate it with manual config and it works fine.
> Thats not my point. I want to configure the bindings programatically.
>
> On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur
> wrote:
>>
>> Don't have an answer off the cuff -- the answer probably depends on
>> the Kryo plugin that you're using.  My recommendation is to take a dig
>> through the akka-kryo-serialization source code
>> , particularly the
>> KryoSerializer class
>> .
>> I learned a huge amount by going through that with the Kryo
>> documentation  and Javadocs
>> 
>>  open;
>> it's not horribly complex, and the process of figuring out how it works
>> teaches pretty much everything critical about using Kryo with Akka...
>>
>> On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:
>>
>>> Greetings,
>>>
>>> In reference to the configuration of serialization bindings I would
>>> like to do this programatically instead of using the config file. I 
>>> have a
>>> type with a static map of types and binding ids based on a Kryo plugin 
>>> to
>>> Akka. What I would like to do is create bindings based on that type and
>>> configure the system accordingly. Does anyone have any example code of 
>>> how
>>> this can be done assuming I have access to the config object already? I
>>> know I can use the default config.with("serialization-bindings".
>>> value) but I don't know the proper way to construct that value and avoid
>>> overwriting anything default in the config. The documentation I have 
>>> read
>>> is not explanatory on this. http://doc.akka.io/docs/
>>> akka/snapshot/scala/serialization.html
>>>
>>> Thanks a bunch.
>>> --
>>> >> 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/grou
>>> p/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/c
> urrent/additional/faq.html
> >> Search the archives: https://groups.google.com/grou
> p/akka-user
> ---
> You received this message because you are subscribed to the Google
> Groups "Akka User List" 

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread kraythe
Doh, didn't know that was there. Bah. Sorry but thanks. :) 

 Do I need to worry about defining any bindings for Akka types such as 
com.google.protobuf.Message or can I safely ignore those without causing 
problems. ? 

On Friday, September 9, 2016 at 3:11:22 PM UTC-5, Konrad Malawski wrote:
>
> parseMap +1
>
> -- 
> Konrad `ktoso` Malawski
> Akka  @ Lightbend 
>
> On 9 September 2016 at 22:10:33, Viktor Klang (viktor...@gmail.com 
> ) wrote:
>
> ConfigFactory.parseMap?
>
> --
> Cheers,
> √
>
> On Sep 9, 2016 22:01, "kraythe"  wrote:
>
>> Yeah, that much I know. However, I have a map of Class -> id in code and 
>> I want to create serialization bindings to this serializer for each of the 
>> types in that map's key set and assign type ids based on the map. What I am 
>> trying to do is figure out how to create the ConfigValue object 
>> programmatically to accomplish that.  
>>
>> Thanks.
>>
>> On Friday, September 9, 2016 at 2:55:32 PM UTC-5, √ wrote: 
>>>
>>> The ActorSystem takes an optional Config when created[1], create that 
>>> Config object programmatically and do 
>>> withFallback(ConfigFactory.load(classloader)) 
>>>
>>>
>>> [1]: 
>>> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/actor/ActorSystem.scala#L141
>>>
>>> On Fri, Sep 9, 2016 at 9:49 PM, kraythe  wrote:
>>>
 I am using Akka-kryo by Roman Levenshtein 
  as recommended on 
 the akka serialization page. I know all about Kryo and have used it many 
 times before. I can integrate it with manual config and it works fine. 
 Thats not my point. I want to configure the bindings programatically.  

 On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote: 
>
> Don't have an answer off the cuff -- the answer probably depends on 
> the Kryo plugin that you're using.  My recommendation is to take a dig 
> through the akka-kryo-serialization source code 
> , particularly the 
> KryoSerializer class 
> .
>   
> I learned a huge amount by going through that with the Kryo 
> documentation  and Javadocs 
> 
>  open; 
> it's not horribly complex, and the process of figuring out how it works 
> teaches pretty much everything critical about using Kryo with Akka...
>
> On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:
>
>> Greetings,  
>>
>> In reference to the configuration of serialization bindings I would 
>> like to do this programatically instead of using the config file. I have 
>> a 
>> type with a static map of types and binding ids based on a Kryo plugin 
>> to 
>> Akka. What I would like to do is create bindings based on that type and 
>> configure the system accordingly. Does anyone have any example code of 
>> how 
>> this can be done assuming I have access to the config object already? I 
>> know I can use the default config.with("serialization-bindings". value) 
>> but 
>> I don't know the proper way to construct that value and avoid 
>> overwriting 
>> anything default in the config. The documentation I have read is not 
>> explanatory on this. 
>> http://doc.akka.io/docs/akka/snapshot/scala/serialization.html
>>
>> Thanks a bunch. 
>> --
>> >> 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+...@googlegroups.com.
 To post to this group, send email to 

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Konrad Malawski
parseMap +1

-- 
Konrad `ktoso` Malawski
Akka  @ Lightbend 

On 9 September 2016 at 22:10:33, Viktor Klang (viktor.kl...@gmail.com)
wrote:

ConfigFactory.parseMap?

--
Cheers,
√

On Sep 9, 2016 22:01, "kraythe"  wrote:

> Yeah, that much I know. However, I have a map of Class -> id in code and I
> want to create serialization bindings to this serializer for each of the
> types in that map's key set and assign type ids based on the map. What I am
> trying to do is figure out how to create the ConfigValue object
> programmatically to accomplish that.
>
> Thanks.
>
> On Friday, September 9, 2016 at 2:55:32 PM UTC-5, √ wrote:
>>
>> The ActorSystem takes an optional Config when created[1], create that
>> Config object programmatically and do 
>> withFallback(ConfigFactory.load(classloader))
>>
>>
>>
>> [1]: https://github.com/akka/akka/blob/master/akka-actor/src
>> /main/scala/akka/actor/ActorSystem.scala#L141
>>
>> On Fri, Sep 9, 2016 at 9:49 PM, kraythe  wrote:
>>
>>> I am using Akka-kryo by Roman Levenshtein
>>>  as recommended on
>>> the akka serialization page. I know all about Kryo and have used it many
>>> times before. I can integrate it with manual config and it works fine.
>>> Thats not my point. I want to configure the bindings programatically.
>>>
>>> On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote:

 Don't have an answer off the cuff -- the answer probably depends on the
 Kryo plugin that you're using.  My recommendation is to take a dig through 
 the
 akka-kryo-serialization source code
 , particularly the
 KryoSerializer class
 .
 I learned a huge amount by going through that with the Kryo
 documentation  and Javadocs
 
  open;
 it's not horribly complex, and the process of figuring out how it works
 teaches pretty much everything critical about using Kryo with Akka...

 On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:

> Greetings,
>
> In reference to the configuration of serialization bindings I would
> like to do this programatically instead of using the config file. I have a
> type with a static map of types and binding ids based on a Kryo plugin to
> Akka. What I would like to do is create bindings based on that type and
> configure the system accordingly. Does anyone have any example code of how
> this can be done assuming I have access to the config object already? I
> know I can use the default config.with("serialization-bindings".
> value) but I don't know the proper way to construct that value and avoid
> overwriting anything default in the config. The documentation I have read
> is not explanatory on this. http://doc.akka.io/docs/
> akka/snapshot/scala/serialization.html
>
> Thanks a bunch.
> --
> >> 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/grou
> p/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/c
>>> urrent/additional/faq.html
>>> >> Search the archives: https://groups.google.com/grou
>>> p/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
> 

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Viktor Klang
ConfigFactory.parseMap?

-- 
Cheers,
√

On Sep 9, 2016 22:01, "kraythe"  wrote:

> Yeah, that much I know. However, I have a map of Class -> id in code and I
> want to create serialization bindings to this serializer for each of the
> types in that map's key set and assign type ids based on the map. What I am
> trying to do is figure out how to create the ConfigValue object
> programmatically to accomplish that.
>
> Thanks.
>
> On Friday, September 9, 2016 at 2:55:32 PM UTC-5, √ wrote:
>>
>> The ActorSystem takes an optional Config when created[1], create that
>> Config object programmatically and do withFallback(ConfigFactory.loa
>> d(classloader))
>>
>>
>> [1]: https://github.com/akka/akka/blob/master/akka-actor/src
>> /main/scala/akka/actor/ActorSystem.scala#L141
>>
>> On Fri, Sep 9, 2016 at 9:49 PM, kraythe  wrote:
>>
>>> I am using Akka-kryo by Roman Levenshtein
>>>  as recommended on
>>> the akka serialization page. I know all about Kryo and have used it many
>>> times before. I can integrate it with manual config and it works fine.
>>> Thats not my point. I want to configure the bindings programatically.
>>>
>>> On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote:

 Don't have an answer off the cuff -- the answer probably depends on the
 Kryo plugin that you're using.  My recommendation is to take a dig through 
 the
 akka-kryo-serialization source code
 , particularly the
 KryoSerializer class
 .
 I learned a huge amount by going through that with the Kryo
 documentation  and Javadocs
 
  open;
 it's not horribly complex, and the process of figuring out how it works
 teaches pretty much everything critical about using Kryo with Akka...

 On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:

> Greetings,
>
> In reference to the configuration of serialization bindings I would
> like to do this programatically instead of using the config file. I have a
> type with a static map of types and binding ids based on a Kryo plugin to
> Akka. What I would like to do is create bindings based on that type and
> configure the system accordingly. Does anyone have any example code of how
> this can be done assuming I have access to the config object already? I
> know I can use the default config.with("serialization-bindings".
> value) but I don't know the proper way to construct that value and avoid
> overwriting anything default in the config. The documentation I have read
> is not explanatory on this. http://doc.akka.io/docs/
> akka/snapshot/scala/serialization.html
>
> Thanks a bunch.
>
> --
> >> 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/grou
> p/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/c
>>> urrent/additional/faq.html
>>> >> Search the archives: https://groups.google.com/grou
>>> p/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 

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread kraythe
Yeah, that much I know. However, I have a map of Class -> id in code and I 
want to create serialization bindings to this serializer for each of the 
types in that map's key set and assign type ids based on the map. What I am 
trying to do is figure out how to create the ConfigValue object 
programmatically to accomplish that. 

Thanks.

On Friday, September 9, 2016 at 2:55:32 PM UTC-5, √ wrote:
>
> The ActorSystem takes an optional Config when created[1], create that 
> Config object programmatically and do 
> withFallback(ConfigFactory.load(classloader))
>
>
> [1]: 
> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/actor/ActorSystem.scala#L141
>
> On Fri, Sep 9, 2016 at 9:49 PM, kraythe  
> wrote:
>
>> I am using Akka-kryo by Roman Levenshtein 
>>  as recommended on the 
>> akka serialization page. I know all about Kryo and have used it many times 
>> before. I can integrate it with manual config and it works fine. Thats not 
>> my point. I want to configure the bindings programatically. 
>>
>> On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote:
>>>
>>> Don't have an answer off the cuff -- the answer probably depends on the 
>>> Kryo plugin that you're using.  My recommendation is to take a dig through 
>>> the 
>>> akka-kryo-serialization source code 
>>> , particularly the 
>>> KryoSerializer class 
>>> .
>>>   
>>> I learned a huge amount by going through that with the Kryo 
>>> documentation  and Javadocs 
>>> 
>>>  open; 
>>> it's not horribly complex, and the process of figuring out how it works 
>>> teaches pretty much everything critical about using Kryo with Akka...
>>>
>>> On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:
>>>
 Greetings, 

 In reference to the configuration of serialization bindings I would 
 like to do this programatically instead of using the config file. I have a 
 type with a static map of types and binding ids based on a Kryo plugin to 
 Akka. What I would like to do is create bindings based on that type and 
 configure the system accordingly. Does anyone have any example code of how 
 this can be done assuming I have access to the config object already? I 
 know I can use the default config.with("serialization-bindings". value) 
 but 
 I don't know the proper way to construct that value and avoid overwriting 
 anything default in the config. The documentation I have read is not 
 explanatory on this. 
 http://doc.akka.io/docs/akka/snapshot/scala/serialization.html

 Thanks a bunch. 

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

Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Viktor Klang
The ActorSystem takes an optional Config when created[1], create that
Config object programmatically and do
withFallback(ConfigFactory.load(classloader))


[1]:
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/actor/ActorSystem.scala#L141

On Fri, Sep 9, 2016 at 9:49 PM, kraythe  wrote:

> I am using Akka-kryo by Roman Levenshtein
>  as recommended on the
> akka serialization page. I know all about Kryo and have used it many times
> before. I can integrate it with manual config and it works fine. Thats not
> my point. I want to configure the bindings programatically.
>
> On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote:
>>
>> Don't have an answer off the cuff -- the answer probably depends on the
>> Kryo plugin that you're using.  My recommendation is to take a dig through 
>> the
>> akka-kryo-serialization source code
>> , particularly the
>> KryoSerializer class
>> .
>> I learned a huge amount by going through that with the Kryo documentation
>>  and Javadocs
>> 
>>  open;
>> it's not horribly complex, and the process of figuring out how it works
>> teaches pretty much everything critical about using Kryo with Akka...
>>
>> On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:
>>
>>> Greetings,
>>>
>>> In reference to the configuration of serialization bindings I would like
>>> to do this programatically instead of using the config file. I have a type
>>> with a static map of types and binding ids based on a Kryo plugin to Akka.
>>> What I would like to do is create bindings based on that type and configure
>>> the system accordingly. Does anyone have any example code of how this can
>>> be done assuming I have access to the config object already? I know I can
>>> use the default config.with("serialization-bindings". value) but I
>>> don't know the proper way to construct that value and avoid overwriting
>>> anything default in the config. The documentation I have read is not
>>> explanatory on this. http://doc.akka.io/docs/
>>> akka/snapshot/scala/serialization.html
>>>
>>> Thanks a bunch.
>>>
>>> --
>>> >> 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/grou
>>> p/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.
>



-- 
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] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread kraythe
I am using Akka-kryo by Roman Levenshtein 
 as recommended on the 
akka serialization page. I know all about Kryo and have used it many times 
before. I can integrate it with manual config and it works fine. Thats not 
my point. I want to configure the bindings programatically. 

On Friday, September 9, 2016 at 2:44:42 PM UTC-5, Justin du coeur wrote:
>
> Don't have an answer off the cuff -- the answer probably depends on the 
> Kryo plugin that you're using.  My recommendation is to take a dig through 
> the 
> akka-kryo-serialization source code 
> , particularly the 
> KryoSerializer class 
> .
>   
> I learned a huge amount by going through that with the Kryo documentation 
>  and Javadocs 
> 
>  open; 
> it's not horribly complex, and the process of figuring out how it works 
> teaches pretty much everything critical about using Kryo with Akka...
>
> On Fri, Sep 9, 2016 at 3:29 PM, kraythe  
> wrote:
>
>> Greetings, 
>>
>> In reference to the configuration of serialization bindings I would like 
>> to do this programatically instead of using the config file. I have a type 
>> with a static map of types and binding ids based on a Kryo plugin to Akka. 
>> What I would like to do is create bindings based on that type and configure 
>> the system accordingly. Does anyone have any example code of how this can 
>> be done assuming I have access to the config object already? I know I can 
>> use the default config.with("serialization-bindings". value) but I don't 
>> know the proper way to construct that value and avoid overwriting anything 
>> default in the config. The documentation I have read is not explanatory on 
>> this. http://doc.akka.io/docs/akka/snapshot/scala/serialization.html
>>
>> Thanks a bunch. 
>>
>> -- 
>> >> 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.


Re: [akka-user] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread Justin du coeur
Don't have an answer off the cuff -- the answer probably depends on the
Kryo plugin that you're using.  My recommendation is to take a dig through the
akka-kryo-serialization source code
, particularly the
KryoSerializer class
.
I learned a huge amount by going through that with the Kryo documentation
 and Javadocs

open;
it's not horribly complex, and the process of figuring out how it works
teaches pretty much everything critical about using Kryo with Akka...

On Fri, Sep 9, 2016 at 3:29 PM, kraythe  wrote:

> Greetings,
>
> In reference to the configuration of serialization bindings I would like
> to do this programatically instead of using the config file. I have a type
> with a static map of types and binding ids based on a Kryo plugin to Akka.
> What I would like to do is create bindings based on that type and configure
> the system accordingly. Does anyone have any example code of how this can
> be done assuming I have access to the config object already? I know I can
> use the default config.with("serialization-bindings". value) but I don't
> know the proper way to construct that value and avoid overwriting anything
> default in the config. The documentation I have read is not explanatory on
> this. http://doc.akka.io/docs/akka/snapshot/scala/serialization.html
>
> Thanks a bunch.
>
> --
> >> 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.


Re: [akka-user] Akka Multithreading on Akka-Cluster

2016-09-09 Thread Justin du coeur
On Fri, Sep 9, 2016 at 2:51 PM, Guido Medina  wrote:

> The problem with explicit is that there are so many "trait" and "classes"
> not really registered which is why I use it,
> it is the newest ID strategy as it register things you might not care but
> commonly used messages you register,
> that way you get performance for what is important and automatic
> registration for other things.
>

Yeah -- like I said, hardcore.  But my situation is extreme: I'm using Kryo
for *persistent* serialization -- as far as I know, Querki may be the first
project doing that in production.  That being the case, I care about the
bytes taken up by FQDNs (and the time required to look them up, and the
risks of things changing out from under me), so I've built out quite a bit

of
infrastructure

to make this work safely.

(Yes, I know -- I'm insane.  But I like Kryo's attitude more than
protobuf's from a code-cohesion POV, so I've invested the time to make it
work solidly for Akka Persistence.)

*Totally* understood about the sheer number of classes involved in making
this work -- I spent quite a while wrestling with that.  But note that I
contributed a new feature to the romix library

to help with this.  The SubclassResolver allows you to register a single
serializer for an entire type hierarchy, when that makes sense.  (Which it
does for many of the common library types.)  I found that this cuts down on
the number of "overhead" registrations required by a *huge* fraction -- you
can suddenly deal with, eg, Set with a single registration instead of six.

And yes, I need to find some time to write up a long blog post about all of
this...

-- 
>>  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] Configuration of SerializationBindings Programmatically?

2016-09-09 Thread kraythe
Greetings, 

In reference to the configuration of serialization bindings I would like to 
do this programatically instead of using the config file. I have a type 
with a static map of types and binding ids based on a Kryo plugin to Akka. 
What I would like to do is create bindings based on that type and configure 
the system accordingly. Does anyone have any example code of how this can 
be done assuming I have access to the config object already? I know I can 
use the default config.with("serialization-bindings". value) but I don't 
know the proper way to construct that value and avoid overwriting anything 
default in the config. The documentation I have read is not explanatory on 
this. http://doc.akka.io/docs/akka/snapshot/scala/serialization.html

Thanks a bunch. 

-- 
>>  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 Multithreading on Akka-Cluster

2016-09-09 Thread Guido Medina
The problem with explicit is that there are so many "trait" and "classes" 
not really registered which is why I use it,
it is the newest ID strategy as it register things you might not care but 
commonly used messages you register,
that way you get performance for what is important and automatic 
registration for other things.

I didn't answer the other thread because I thought my question needed to be 
answered first,
also; asked by a different person of the same team so I got a bit confused 
there, it was a bit of a hijacking the other thread.

HTH,

Guido.

On Friday, September 9, 2016 at 5:56:16 PM UTC+1, Justin du coeur wrote:
>
> On Fri, Sep 9, 2016 at 12:27 PM, Guido Medina  > wrote:
>
>> Also, what ID strategy are you using? I see none configured so it it is 
>> using the default, try setting it like I posted in the example which is 
>> "automatic"
>>
>
> Yeah, this is what I was going to suggest.  The default idstrategy, 
> "incremental", is an *extremely* bad idea for any sort of real code.  From 
> what I see here, you're not explicitly registering ActorRef, which means 
> that the sending end is going to pick a serialization ID when it goes to 
> serialize the ActorRef; at the receiving end, it's going to get that 
> randomly-chosen ID, not know what to do with it, and probably crash.
>
> Personally, I favor 'idstrategy="explicit"', but that's hardcore, and a 
> lot of extra effort.  Automatic is easier, and likely to work adequately in 
> practice...
>

-- 
>>  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] Cluster seed nodes resulting in multiple split brains?

2016-09-09 Thread kraythe
Greetings, 

We are having some problems with our cluster configuration that manifest 
themselves in the following log lines (redacted for confidentiality 
reasons. 

Sep 09 00:58:10 host1.mycompany.com application-9001.log:  2016-09-09 05:58:
10 + - [WARN] - [OrdersActor] akka://myCompany/user/OrdersActor/291 - 
 (291) #recordTxns, sending 54 txns to UserActor took 0.0044229 seconds
Sep 09 00:58:19 host1.mycompany.com application-9001.log:  2016-09-09 05:58:
19 + - [WARN] - [ShardRegion] 
akka.tcp://myCompany@10.8.1.169:2551/system/sharding/UserActor 
-  Trying to register to coordinator at [None], but no acknowledgement. 
Total [54] buffered messages.

I have traced this to the configuration of the cluster. We are running this 
on Amazon AWS and the code includes use of Hazelcast for finding the IPs of 
the other nodes (mostly because we have solved discovery for hazelcast in 
our dynamic IP cluster). We retrieve the IPs of the other nodes in the 
cluster from hazelcast and appropriately use them to create the Address 
object to use in the seed node. Once we have the seed nodes we have tried 
two mechanisms. First is to take the list of seed nodes and use them to 
join the cluster with cluster.joinSeedNodes(). Of Course not all machines 
come up and are discovered by hazelcast at exactly the same instant so the 
first 3 nodes might come up first and use each other to join whereas by the 
time the 9th node comes up there are 9 seed nodes. When we start sending 
messages to cluster shared actors, we get the errors above. Also when a 
node goes down the system screams constantly that a seed node is gone. So I 
changed the code to pick a node at random and do a cluster.join() with that 
node instead. However, we have the same problem as above. However, when we 
first bring up one node then bring them up one at a time, the problem goes 
away. Another symptom is that if we have the problem above and we terminate 
host1 then other nodes start propagating this behavior. Probably all the 
other nodes that were connected to host1. Apparently they can't heal to 
connect to another node. So this lends evidence to the multiple split 
brains theory. 

My theory is that by using all these seed nodes I am creating multiple 
split brains. So if you have 5 nodes, A, B, C, D, E and A connects to B, B 
to A, C to E, E to D, D to E then we have two clusters running that know 
nothing about each other. For some reason then the coordinators get 
confused about what is going on. 

Essentially the problem domain is this: 1. We don't know what ANY of the 
IPs are ahead of time. 2) We want the cluster to be whole. 3) If a single 
node leaves the cluster we would like the remaining nodes to recover. 

I would appreciate any insight anyone could provide on this and especially 
what may be the problem (I could be wrong), and how we can accomplish our 
goals. Note that I am not committed to using hazelcast to find other nodes. 

 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.


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

2016-09-09 Thread Justin du coeur
See the other thread -- this confirms what I was saying.  The receiving
Actor hasn't registered anything for ActorRef, so it's going splat...

On Fri, Sep 9, 2016 at 12:37 PM, antonio meo  wrote:

> Sorry Guys,
> I'm testing an Akka-Cluster with two actor that send one to an another a
> custom message formed by two Strings and an ActorRef.
> When the second actor receives the message (serialized with kryo) it just
> become unreachable.
>
> That's the trace of the second actor:
>
>
> 00:35 TRACE: [kryo] Register class ID 0: int (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$IntSerializer)
> 00:35 TRACE: [kryo] Register class ID 1: String (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$StringSerializer)
> 00:35 TRACE: [kryo] Register class ID 2: float (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$FloatSerializer)
> 00:35 TRACE: [kryo] Register class ID 3: boolean
> (com.esotericsoftware.kryo.serializers.DefaultSerializers$
> BooleanSerializer)
> 00:35 TRACE: [kryo] Register class ID 4: byte (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$ByteSerializer)
> 00:35 TRACE: [kryo] Register class ID 5: char (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$CharSerializer)
> 00:35 TRACE: [kryo] Register class ID 6: short (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$ShortSerializer)
> 00:35 TRACE: [kryo] Register class ID 7: long (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$LongSerializer)
> 00:35 TRACE: [kryo] Register class ID 8: double (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$DoubleSerializer)
> 00:35 TRACE: [kryo] Register class ID 9: void (com.esotericsoftware.kryo.
> serializers.DefaultSerializers$VoidSerializer)
> 00:35 TRACE: [kryo] Register class ID 10: scala.Enumeration$Val
> (com.romix.scala.serialization.kryo.EnumerationSerializer)
> 00:35 TRACE: [kryo] Register class ID 11: scala.Enumeration$Value
> (com.romix.scala.serialization.kryo.EnumerationSerializer)
> 00:35 TRACE: [kryo] Registration required: false
> 00:35 TRACE: [kryo] Optimize ints: true
> 00:35 TRACE: [kryo] Field email: class java.lang.String
> 00:35 TRACE: [kryo] Field customerCode: class java.lang.String
> 00:35 TRACE: [kryo] Field sender: class akka.actor.ActorRef
> 00:35 TRACE: [kryo] Register class ID 20: com.test.common.LoginRequest
> (com.esotericsoftware.kryo.serializers.FieldSerializer)
> 00:35 TRACE: [kryo] References: false
>
> Thanks for any help,
> Antonio
>
>
>
>
>
> Il giorno venerdì 9 settembre 2016 00:24:56 UTC+2, Federico Nusymowicz ha
> scritto:
>>
>> 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" 

Re: [akka-user] Akka Multithreading on Akka-Cluster

2016-09-09 Thread Justin du coeur
On Fri, Sep 9, 2016 at 12:27 PM, Guido Medina  wrote:

> Also, what ID strategy are you using? I see none configured so it it is
> using the default, try setting it like I posted in the example which is
> "automatic"
>

Yeah, this is what I was going to suggest.  The default idstrategy,
"incremental", is an *extremely* bad idea for any sort of real code.  From
what I see here, you're not explicitly registering ActorRef, which means
that the sending end is going to pick a serialization ID when it goes to
serialize the ActorRef; at the receiving end, it's going to get that
randomly-chosen ID, not know what to do with it, and probably crash.

Personally, I favor 'idstrategy="explicit"', but that's hardcore, and a lot
of extra effort.  Automatic is easier, and likely to work adequately in
practice...

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

2016-09-09 Thread antonio meo
Sorry Guys,
I'm testing an Akka-Cluster with two actor that send one to an another a 
custom message formed by two Strings and an ActorRef.
When the second actor receives the message (serialized with kryo) it just 
become unreachable.

That's the trace of the second actor:


00:35 TRACE: [kryo] Register class ID 0: int 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$IntSerializer)
00:35 TRACE: [kryo] Register class ID 1: String 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer)
00:35 TRACE: [kryo] Register class ID 2: float 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$FloatSerializer)
00:35 TRACE: [kryo] Register class ID 3: boolean 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$BooleanSerializer)
00:35 TRACE: [kryo] Register class ID 4: byte 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$ByteSerializer)
00:35 TRACE: [kryo] Register class ID 5: char 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$CharSerializer)
00:35 TRACE: [kryo] Register class ID 6: short 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$ShortSerializer)
00:35 TRACE: [kryo] Register class ID 7: long 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$LongSerializer)
00:35 TRACE: [kryo] Register class ID 8: double 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$DoubleSerializer)
00:35 TRACE: [kryo] Register class ID 9: void 
(com.esotericsoftware.kryo.serializers.DefaultSerializers$VoidSerializer)
00:35 TRACE: [kryo] Register class ID 10: scala.Enumeration$Val 
(com.romix.scala.serialization.kryo.EnumerationSerializer)
00:35 TRACE: [kryo] Register class ID 11: scala.Enumeration$Value 
(com.romix.scala.serialization.kryo.EnumerationSerializer)
00:35 TRACE: [kryo] Registration required: false
00:35 TRACE: [kryo] Optimize ints: true
00:35 TRACE: [kryo] Field email: class java.lang.String
00:35 TRACE: [kryo] Field customerCode: class java.lang.String
00:35 TRACE: [kryo] Field sender: class akka.actor.ActorRef
00:35 TRACE: [kryo] Register class ID 20: com.test.common.LoginRequest 
(com.esotericsoftware.kryo.serializers.FieldSerializer)
00:35 TRACE: [kryo] References: false

Thanks for any help,
Antonio



 

Il giorno venerdì 9 settembre 2016 00:24:56 UTC+2, Federico Nusymowicz ha 
scritto:
>
> 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] Re: Akka Multithreading on Akka-Cluster

2016-09-09 Thread Guido Medina
And newest Akka Kryo doesn't require pool-size as that's a 
java.util.ConcurrentLinkedQueue by default.
I contributed that new mechanism to use ConcurrentLinkedQueue for the pool 
or your own implementation (See KryoQueueBuilder example in their doc).

On Monday, September 5, 2016 at 10:22:28 AM UTC+1, silvio poma wrote:
>
> Hi All, 
> Working on a project for a big client that want to switch from a 
> monolithic infrastructure to a microservice one we are getting stuck in a 
> big doubt.
> We are making an infrastructure where each microservice are deployed in a 
> different container on an ECS instance, than we have the first microservice 
> that receive a message from the client via HTTP and this message triggers 
> all the actors that start to send message one to each others.
> We've created an Akka-Cluster and each microservice is a node of the 
> cluster. Every Actor send a message to a Router 
> (cluster-metrics-adaptive-group) that has his  routees.paths that points to 
> the specific node.
> Testing the performances of our system we realize that everything is too 
> slow and there is not any multithreading.
> How does multithreading work? Is our infrastructure too complex? Is there 
> any best-practice we can implement to improve our system? 
> Thanks all! 
> Silvio
>
>

-- 
>>  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 Multithreading on Akka-Cluster

2016-09-09 Thread Guido Medina
Also, what ID strategy are you using? I see none configured so it it is 
using the default, try setting it like I posted in the example which is 
"automatic"

On Friday, September 9, 2016 at 5:26:00 PM UTC+1, Guido Medina wrote:
>
> Are you sharing the same conf file? if you registered classes then all 
> nodes must share the same Kryo config.
>
> On Friday, September 9, 2016 at 3:44:38 PM UTC+1, silvio poma wrote:
>>
>> Just to be clear, my class: com.test.common.LoginRequest  is formed of 4 
>> strings and an actorRef
>> Thanks all 
>>
>> 2016-09-09 16:34 GMT+02:00 silvio poma :
>>
>>> Right now one of the biggest and strange problem is that when arrive a 
>>> message from the Actor A in the node 1 to the actor B in the node 2 the 
>>> node 2 is immediately disassociated from the cluster. The message that the 
>>> actor A sends to actor B is our custom class that we are serializing using 
>>> kryo (as u suggested).
>>>
>>> This is our config file: 
>>>
>>> akka.extensions = 
>>> ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]
>>>
>>> akka.actor.kryo  {
>>> 
>>> reference-enabled = true
>>>
>>>
>>> implicit-registration-enabled = true
>>>
>>> implicit-registration-logging = false
>>>
>>>
>>> buffer-size = 4096
>>>
>>>
>>> max-buffer-size = 1073741824
>>>
>>> 
>>> serializer-pool-size = 16
>>>
>>>
>>> kryo-trace = false
>>>
>>> 
>>> kryo-reference-map = true
>>>
>>> mappings {
>>> "com.test.common.LoginRequest" = 20
>>> 
>>>
>>> }
>>>
>>> 
>>> classes = [
>>> "com.test.common.LoginRequest"
>>> 
>>> ]
>>> }
>>>
>>> #akka.actor.serialize-messages = on
>>>
>>> akka.actor.serializers {
>>> java = "akka.serialization.JavaSerializer"
>>> kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
>>> }
>>>
>>> akka.actor.serialization-bindings {
>>>
>>> "com.test.common.LoginRequest" = kryo
>>> } 
>>>
>>> Il giorno venerdì 9 settembre 2016 15:32:32 UTC+2, Guido Medina ha 
>>> scritto:

 What problems are you facing?
 I'm in my second project with Java 8 + Akka so maybe I can help.

 To integrate the akka-kryo extension all you need is the dependency and 
 few lines at the configuration you are using, no code changes are needed, 
 here is an example:

 akka {
   // Log4j2 extension
   loggers = ["de.heikoseeberger.akkalog4j.Log4jLogger"]
   logging-filter = "de.heikoseeberger.akkalog4j.Log4jLoggingFilter"

   // akka-kryo extension
   extensions = 
 ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]

   actor {
 provider = "akka.cluster.ClusterActorRefProvider"
 serializers.java = 
 "com.romix.akka.serialization.kryo.KryoSerializer"

 serialization-bindings {
   // Classes that don't implement serializable list here one by one
   // to bind them to the Java serializer which you changed to Kryo.
   "io.vertx.core.json.JsonObject" = java
 }

 // I don't like to have too many threads so for non-blocking stuff 
 I think N x CPU is enough where N = 1..4
 default-dispatcher {
   type = Dispatcher
   executor = "fork-join-executor"

   fork-join-executor {
 parallelism-min = 4
 parallelism-factor = 1
 parallelism-max = 8
   }
 }

 kryo {
   kryo-reference-map = false
   idstrategy = "automatic"
   use-manifests = true
   buffer-size = 1024
   type = "nograph"

   // To avoid serializing the class name list your remote message 
 classes here:
   classes = [
 "com.company.class_1",

 "io.vertx.core.json.JsonObject",

 "java.util.ArrayList"
   ]
 }
   }

   // My current remote configuration, enough threads (not too many) for 
 a cluster of up to 12 nodes
   remote {
 log-remote-lifecycle-events = off

 netty.tcp {
   port = 0

   server-socket-worker-pool {
 pool-size-min = 4
 pool-size-factor = 1
 pool-size-max = 8
   }

   client-socket-worker-pool {
 pool-size-min = 4
 pool-size-factor = 1
 pool-size-max = 8
   }
 }

 default-remote-dispatcher {
   type = Dispatcher
   executor = "fork-join-executor"

   fork-join-executor {
 parallelism-min = 4
 parallelism-factor = 1
 parallelism-max = 8
   }
 }
   }

   cluster {
 metrics.enabled = off
 jmx.enabled = off
   }
 }

 HTH,

 Guido.

 On Friday, September 9, 2016 at 8:43:39 AM UTC+1, silvio poma wrote:
>
> 

Re: [akka-user] Akka Multithreading on Akka-Cluster

2016-09-09 Thread Guido Medina
Are you sharing the same conf file? if you registered classes then all 
nodes must share the same Kryo config.

On Friday, September 9, 2016 at 3:44:38 PM UTC+1, silvio poma wrote:
>
> Just to be clear, my class: com.test.common.LoginRequest  is formed of 4 
> strings and an actorRef
> Thanks all 
>
> 2016-09-09 16:34 GMT+02:00 silvio poma 
> :
>
>> Right now one of the biggest and strange problem is that when arrive a 
>> message from the Actor A in the node 1 to the actor B in the node 2 the 
>> node 2 is immediately disassociated from the cluster. The message that the 
>> actor A sends to actor B is our custom class that we are serializing using 
>> kryo (as u suggested).
>>
>> This is our config file: 
>>
>> akka.extensions = 
>> ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]
>>
>> akka.actor.kryo  {
>> 
>> reference-enabled = true
>>
>>
>> implicit-registration-enabled = true
>>
>> implicit-registration-logging = false
>>
>>
>> buffer-size = 4096
>>
>>
>> max-buffer-size = 1073741824
>>
>> 
>> serializer-pool-size = 16
>>
>>
>> kryo-trace = false
>>
>> 
>> kryo-reference-map = true
>>
>> mappings {
>> "com.test.common.LoginRequest" = 20
>> 
>>
>> }
>>
>> 
>> classes = [
>> "com.test.common.LoginRequest"
>> 
>> ]
>> }
>>
>> #akka.actor.serialize-messages = on
>>
>> akka.actor.serializers {
>> java = "akka.serialization.JavaSerializer"
>> kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
>> }
>>
>> akka.actor.serialization-bindings {
>>
>> "com.test.common.LoginRequest" = kryo
>> } 
>>
>> Il giorno venerdì 9 settembre 2016 15:32:32 UTC+2, Guido Medina ha 
>> scritto:
>>>
>>> What problems are you facing?
>>> I'm in my second project with Java 8 + Akka so maybe I can help.
>>>
>>> To integrate the akka-kryo extension all you need is the dependency and 
>>> few lines at the configuration you are using, no code changes are needed, 
>>> here is an example:
>>>
>>> akka {
>>>   // Log4j2 extension
>>>   loggers = ["de.heikoseeberger.akkalog4j.Log4jLogger"]
>>>   logging-filter = "de.heikoseeberger.akkalog4j.Log4jLoggingFilter"
>>>
>>>   // akka-kryo extension
>>>   extensions = 
>>> ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]
>>>
>>>   actor {
>>> provider = "akka.cluster.ClusterActorRefProvider"
>>> serializers.java = "com.romix.akka.serialization.kryo.KryoSerializer"
>>>
>>> serialization-bindings {
>>>   // Classes that don't implement serializable list here one by one
>>>   // to bind them to the Java serializer which you changed to Kryo.
>>>   "io.vertx.core.json.JsonObject" = java
>>> }
>>>
>>> // I don't like to have too many threads so for non-blocking stuff I 
>>> think N x CPU is enough where N = 1..4
>>> default-dispatcher {
>>>   type = Dispatcher
>>>   executor = "fork-join-executor"
>>>
>>>   fork-join-executor {
>>> parallelism-min = 4
>>> parallelism-factor = 1
>>> parallelism-max = 8
>>>   }
>>> }
>>>
>>> kryo {
>>>   kryo-reference-map = false
>>>   idstrategy = "automatic"
>>>   use-manifests = true
>>>   buffer-size = 1024
>>>   type = "nograph"
>>>
>>>   // To avoid serializing the class name list your remote message 
>>> classes here:
>>>   classes = [
>>> "com.company.class_1",
>>>
>>> "io.vertx.core.json.JsonObject",
>>>
>>> "java.util.ArrayList"
>>>   ]
>>> }
>>>   }
>>>
>>>   // My current remote configuration, enough threads (not too many) for 
>>> a cluster of up to 12 nodes
>>>   remote {
>>> log-remote-lifecycle-events = off
>>>
>>> netty.tcp {
>>>   port = 0
>>>
>>>   server-socket-worker-pool {
>>> pool-size-min = 4
>>> pool-size-factor = 1
>>> pool-size-max = 8
>>>   }
>>>
>>>   client-socket-worker-pool {
>>> pool-size-min = 4
>>> pool-size-factor = 1
>>> pool-size-max = 8
>>>   }
>>> }
>>>
>>> default-remote-dispatcher {
>>>   type = Dispatcher
>>>   executor = "fork-join-executor"
>>>
>>>   fork-join-executor {
>>> parallelism-min = 4
>>> parallelism-factor = 1
>>> parallelism-max = 8
>>>   }
>>> }
>>>   }
>>>
>>>   cluster {
>>> metrics.enabled = off
>>> jmx.enabled = off
>>>   }
>>> }
>>>
>>> HTH,
>>>
>>> Guido.
>>>
>>> On Friday, September 9, 2016 at 8:43:39 AM UTC+1, silvio poma wrote:

 Hi Guys, Thanks a lot everybody. Yours tips were very useful and we are 
 working on it.
 We've already improved the router and the disptachers configuration 
 achieving very good results.
 Now we are trying to leave the java serialization and pass to another 
 one more efficient, but we are having some troubles in this field.
 Can some one point me any guides to follow? (Please notice 

[akka-user] Terminate ActorSystem on stream failure

2016-09-09 Thread Victor
Hi,

How can I terminate the ActorSystem running my stream when the stream fails?

If I have the following stream:

A -> B -> C

and B fails with a stoppingStrategy, what happens exactly? A and C actors 
are still running? How can I catch such stopping to then terminate the 
ActorSystem?

I think I have to use materialized value but it's not clear because if it's 
the solution I would have to return a Future as a materialized value from 
each of my stages to then listen on failures. It seems heavy :)

Thank in advance,
Victor

-- 
>>  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] ANNOUNCE: New Remoting Milestone 4

2016-09-09 Thread Patrik Nordwall
Dear hakkers,

We are pleased to announce the availability of the fourth development
milestone of the new Akka Remoting, codenamed Artery. It’s a development
preview and we encourage you to try it out and give us feedback, but it’s
not intended for production usage yet.

The version number is 2.4-ARTERY-M4 with same artifacts as usual.

It is enabled with the following configuration:

akka.remote.artery {

 enabled = on

 # The hostname or ip clients should connect to.

 canonical.hostname = localhost

 # use 0 if you want a random available port

 canonical.port = 25520

}

Note that the configuration has changed since M3.

The protocol part of the actor system address is akka, so you need to
change previous akka.tcp to akka in for example configuration of cluster
seed-nodes. Note that this has changed from artery to akka since M3.

A summary of what is included in M4 compared to M3
:


   -

   send heartbeat messages over the control stream, so that failure
   detectors are not disturbed by heavy traffic of ordinary messages
   -

   support for parallel serialization and deserialization
   -

   bind hostname and port for usage with Docker or NAT environment
   -

   many bug fixes, most cluster tests are now passing


The full list of changes since the last milestone is available under the
2.4-ARTERY-M3 
milestone on github for your reference.

We are using Aeron  as the underlying
transport and are implementing the layers on top using Akka Streams. You
find more details in the design document
.

The development branch is artery-dev
, in case you want to take a
look or contribute. Issues are labeled with t:remoting:artery

.

In the next three weeks we will work on additional hardening and testing,
followed by releasing it in a 2.4.x version of Akka as an optional
transport.

We would also like to ask you to take the Akka Community Survey
. This
is a great opportunity for you to influence what we will work on next.
Pssst... you can also win a t-shirt.

Happy hakking!

-- 

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] Re: Testing routes and marshalling

2016-09-09 Thread Akka Team
Hi Richard,

The HTTP Testkit expects to have gotten the reply already when check
executes, so that is why it does not work.

You can use the autopilot feature of the TestProbe or a custom test actor
responding the way you want in the test, it could also keep incoming
requests for later assertions.

--
Johan
Akka Team

On Wed, Sep 7, 2016 at 1:47 AM, Richard Rodseth  wrote:

> Oy. I'm getting tied up in knots. I guess the requestHandlerProbe.reply
> won't work without a proper sender. I usually put my route definition in an
> actor, but moved it to a trait so that it could be used by the test kit.
> But I did it like this
>
> def route(requestHandler: ActorRef) = ...
>
> Can anyone point me at a sample which uses the ask pattern in routes, and
> also tests the routes with the ScalatestRouteTest?
>
> On Tue, Sep 6, 2016 at 12:56 PM, Richard Rodseth 
> wrote:
>
>> So the example here is not very realistic because the route does not
>> depend on any actors:
>>
>> http://doc.akka.io/docs/akka/2.4.9/scala/http/routing-dsl/te
>> stkit.html#Usage
>>
>> I have a status api that returns Either[APIError, StatusDTO].
>>
>> val statusRoute = path("status") {
>>
>>   get {
>>
>> handleErrors {
>>
>>   onSuccess(requestHandler ? RequestHandler.AskForStatus) {
>>
>>   complete(result)
>>
>>   }
>>
>> }
>>
>>   }
>>
>> }
>>  Pondering whether to make a mock actor for requestHandler, or use a
>> probe.
>>
>> This works:
>>
>>   Get("/status") ~> myRoute ~> check {
>>
>> requestHandlerProbe.expectMsgClass(100 millis,
>> RequestHandler.AskForStatus.getClass)
>>
>>   }
>>
>> This times out
>>
>>   Get("/status") ~> myRoute ~> check {
>>
>> requestHandlerProbe.expectMsgClass(100 millis,
>> RequestHandler.AskForStatus.getClass)
>>
>>  val result: Either[APIError, StatusDTO] = Right(StatusDTO("message"
>> ))
>>
>> requestHandlerProbe.reply(result)
>>
>> println(this.responseEntity)
>>
>>   }
>>
>> Any errors in my use of probe.reply ? Would it be better to test response
>> marshalling on its own and limit routing tests to expectMsg?
>>
>>
>>
> --
> >> 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: Kryo serialization not working?

2016-09-09 Thread Akka Team
Good that you figured it out, and thanks for sharing what was wrong rather
than leaving the question open!

--
Johan
Akka Team

On Fri, Sep 9, 2016 at 2:28 AM, Federico Nusymowicz 
wrote:

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

2016-09-09 Thread Akka Team
No, no plans currently

--
Johan
Akka Team

On Fri, Sep 9, 2016 at 4:02 AM, Zhaojie Niu  wrote:

> Dear Johan:
>
> Thanks for your reply.
>
> Does Akka team have any plans to support GPU?
>
> 在 2016年9月8日星期四 UTC+8下午10:08:32,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/c
>>> urrent/additional/faq.html
>>> >> Search the archives: https://groups.google.com/grou
>>> p/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.
>



-- 
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 Multithreading on Akka-Cluster

2016-09-09 Thread silvio poma
Just to be clear, my class: com.test.common.LoginRequest  is formed of 4
strings and an actorRef
Thanks all

2016-09-09 16:34 GMT+02:00 silvio poma :

> Right now one of the biggest and strange problem is that when arrive a
> message from the Actor A in the node 1 to the actor B in the node 2 the
> node 2 is immediately disassociated from the cluster. The message that the
> actor A sends to actor B is our custom class that we are serializing using
> kryo (as u suggested).
>
> This is our config file:
>
> akka.extensions = ["com.romix.akka.serialization.kryo.
> KryoSerializationExtension$"]
>
> akka.actor.kryo  {
>
> reference-enabled = true
>
>
> implicit-registration-enabled = true
>
> implicit-registration-logging = false
>
>
> buffer-size = 4096
>
>
> max-buffer-size = 1073741824
>
>
> serializer-pool-size = 16
>
>
> kryo-trace = false
>
>
> kryo-reference-map = true
>
> mappings {
> "com.test.common.LoginRequest" = 20
>
>
> }
>
>
> classes = [
> "com.test.common.LoginRequest"
>
> ]
> }
>
> #akka.actor.serialize-messages = on
>
> akka.actor.serializers {
> java = "akka.serialization.JavaSerializer"
> kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
> }
>
> akka.actor.serialization-bindings {
>
> "com.test.common.LoginRequest" = kryo
> }
>
> Il giorno venerdì 9 settembre 2016 15:32:32 UTC+2, Guido Medina ha scritto:
>>
>> What problems are you facing?
>> I'm in my second project with Java 8 + Akka so maybe I can help.
>>
>> To integrate the akka-kryo extension all you need is the dependency and
>> few lines at the configuration you are using, no code changes are needed,
>> here is an example:
>>
>> akka {
>>   // Log4j2 extension
>>   loggers = ["de.heikoseeberger.akkalog4j.Log4jLogger"]
>>   logging-filter = "de.heikoseeberger.akkalog4j.Log4jLoggingFilter"
>>
>>   // akka-kryo extension
>>   extensions = ["com.romix.akka.serialization
>> .kryo.KryoSerializationExtension$"]
>>
>>   actor {
>> provider = "akka.cluster.ClusterActorRefProvider"
>> serializers.java = "com.romix.akka.serialization.kryo.KryoSerializer"
>>
>> serialization-bindings {
>>   // Classes that don't implement serializable list here one by one
>>   // to bind them to the Java serializer which you changed to Kryo.
>>   "io.vertx.core.json.JsonObject" = java
>> }
>>
>> // I don't like to have too many threads so for non-blocking stuff I
>> think N x CPU is enough where N = 1..4
>> default-dispatcher {
>>   type = Dispatcher
>>   executor = "fork-join-executor"
>>
>>   fork-join-executor {
>> parallelism-min = 4
>> parallelism-factor = 1
>> parallelism-max = 8
>>   }
>> }
>>
>> kryo {
>>   kryo-reference-map = false
>>   idstrategy = "automatic"
>>   use-manifests = true
>>   buffer-size = 1024
>>   type = "nograph"
>>
>>   // To avoid serializing the class name list your remote message
>> classes here:
>>   classes = [
>> "com.company.class_1",
>>
>> "io.vertx.core.json.JsonObject",
>>
>> "java.util.ArrayList"
>>   ]
>> }
>>   }
>>
>>   // My current remote configuration, enough threads (not too many) for a
>> cluster of up to 12 nodes
>>   remote {
>> log-remote-lifecycle-events = off
>>
>> netty.tcp {
>>   port = 0
>>
>>   server-socket-worker-pool {
>> pool-size-min = 4
>> pool-size-factor = 1
>> pool-size-max = 8
>>   }
>>
>>   client-socket-worker-pool {
>> pool-size-min = 4
>> pool-size-factor = 1
>> pool-size-max = 8
>>   }
>> }
>>
>> default-remote-dispatcher {
>>   type = Dispatcher
>>   executor = "fork-join-executor"
>>
>>   fork-join-executor {
>> parallelism-min = 4
>> parallelism-factor = 1
>> parallelism-max = 8
>>   }
>> }
>>   }
>>
>>   cluster {
>> metrics.enabled = off
>> jmx.enabled = off
>>   }
>> }
>>
>> HTH,
>>
>> Guido.
>>
>> On Friday, September 9, 2016 at 8:43:39 AM UTC+1, silvio poma wrote:
>>>
>>> Hi Guys, Thanks a lot everybody. Yours tips were very useful and we are
>>> working on it.
>>> We've already improved the router and the disptachers configuration
>>> achieving very good results.
>>> Now we are trying to leave the java serialization and pass to another
>>> one more efficient, but we are having some troubles in this field.
>>> Can some one point me any guides to follow? (Please notice that we are
>>> writing in Java and not in Scala)
>>> Thanks Guys,
>>> Silvio
>>>
>>> Il giorno mercoledì 7 settembre 2016 17:52:39 UTC+2, √ ha scritto:

 IMO Artery won't help much if using Java Serialization.
 Java Serialization is notoriously slow.

 On Wed, Sep 7, 2016 at 5:50 PM, Guido Medina  wrote:

> Artery is at  in milestone 3 (m3), you are welcome to use as I believe
> it is in an 

Re: [akka-user] Akka Multithreading on Akka-Cluster

2016-09-09 Thread silvio poma
Right now one of the biggest and strange problem is that when arrive a 
message from the Actor A in the node 1 to the actor B in the node 2 the 
node 2 is immediately disassociated from the cluster. The message that the 
actor A sends to actor B is our custom class that we are serializing using 
kryo (as u suggested).

This is our config file: 

akka.extensions = 
["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]

akka.actor.kryo  {

reference-enabled = true

   
implicit-registration-enabled = true

implicit-registration-logging = false


buffer-size = 4096

   
max-buffer-size = 1073741824


serializer-pool-size = 16

   
kryo-trace = false


kryo-reference-map = true

mappings {
"com.test.common.LoginRequest" = 20

   
}


classes = [
"com.test.common.LoginRequest"

]
}

#akka.actor.serialize-messages = on

akka.actor.serializers {
java = "akka.serialization.JavaSerializer"
kryo = "com.romix.akka.serialization.kryo.KryoSerializer"
}

akka.actor.serialization-bindings {

"com.test.common.LoginRequest" = kryo
} 

Il giorno venerdì 9 settembre 2016 15:32:32 UTC+2, Guido Medina ha scritto:
>
> What problems are you facing?
> I'm in my second project with Java 8 + Akka so maybe I can help.
>
> To integrate the akka-kryo extension all you need is the dependency and 
> few lines at the configuration you are using, no code changes are needed, 
> here is an example:
>
> akka {
>   // Log4j2 extension
>   loggers = ["de.heikoseeberger.akkalog4j.Log4jLogger"]
>   logging-filter = "de.heikoseeberger.akkalog4j.Log4jLoggingFilter"
>
>   // akka-kryo extension
>   extensions = 
> ["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]
>
>   actor {
> provider = "akka.cluster.ClusterActorRefProvider"
> serializers.java = "com.romix.akka.serialization.kryo.KryoSerializer"
>
> serialization-bindings {
>   // Classes that don't implement serializable list here one by one
>   // to bind them to the Java serializer which you changed to Kryo.
>   "io.vertx.core.json.JsonObject" = java
> }
>
> // I don't like to have too many threads so for non-blocking stuff I 
> think N x CPU is enough where N = 1..4
> default-dispatcher {
>   type = Dispatcher
>   executor = "fork-join-executor"
>
>   fork-join-executor {
> parallelism-min = 4
> parallelism-factor = 1
> parallelism-max = 8
>   }
> }
>
> kryo {
>   kryo-reference-map = false
>   idstrategy = "automatic"
>   use-manifests = true
>   buffer-size = 1024
>   type = "nograph"
>
>   // To avoid serializing the class name list your remote message 
> classes here:
>   classes = [
> "com.company.class_1",
>
> "io.vertx.core.json.JsonObject",
>
> "java.util.ArrayList"
>   ]
> }
>   }
>
>   // My current remote configuration, enough threads (not too many) for a 
> cluster of up to 12 nodes
>   remote {
> log-remote-lifecycle-events = off
>
> netty.tcp {
>   port = 0
>
>   server-socket-worker-pool {
> pool-size-min = 4
> pool-size-factor = 1
> pool-size-max = 8
>   }
>
>   client-socket-worker-pool {
> pool-size-min = 4
> pool-size-factor = 1
> pool-size-max = 8
>   }
> }
>
> default-remote-dispatcher {
>   type = Dispatcher
>   executor = "fork-join-executor"
>
>   fork-join-executor {
> parallelism-min = 4
> parallelism-factor = 1
> parallelism-max = 8
>   }
> }
>   }
>
>   cluster {
> metrics.enabled = off
> jmx.enabled = off
>   }
> }
>
> HTH,
>
> Guido.
>
> On Friday, September 9, 2016 at 8:43:39 AM UTC+1, silvio poma wrote:
>>
>> Hi Guys, Thanks a lot everybody. Yours tips were very useful and we are 
>> working on it.
>> We've already improved the router and the disptachers configuration 
>> achieving very good results.
>> Now we are trying to leave the java serialization and pass to another one 
>> more efficient, but we are having some troubles in this field.
>> Can some one point me any guides to follow? (Please notice that we are 
>> writing in Java and not in Scala)  
>> Thanks Guys,
>> Silvio
>>
>> Il giorno mercoledì 7 settembre 2016 17:52:39 UTC+2, √ ha scritto:
>>>
>>> IMO Artery won't help much if using Java Serialization.
>>> Java Serialization is notoriously slow.
>>>
>>> On Wed, Sep 7, 2016 at 5:50 PM, Guido Medina  wrote:
>>>
 Artery is at  in milestone 3 (m3), you are welcome to use as I believe 
 it is in an extremely good shape but I would pursue both,
 as it will only require you a day of work (as a newbie) in 
 configuration and dependencies, no code changes will be required:


 http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-remote_2.11%7C2.4-ARTERY-M3%7Cjar

 As for 

Re: [akka-user] Akka Multithreading on Akka-Cluster

2016-09-09 Thread Guido Medina
What problems are you facing?
I'm in my second project with Java 8 + Akka so maybe I can help.

To integrate the akka-kryo extension all you need is the dependency and few 
lines at the configuration you are using, no code changes are needed, here 
is an example:

akka {
  // Log4j2 extension
  loggers = ["de.heikoseeberger.akkalog4j.Log4jLogger"]
  logging-filter = "de.heikoseeberger.akkalog4j.Log4jLoggingFilter"

  // akka-kryo extension
  extensions = 
["com.romix.akka.serialization.kryo.KryoSerializationExtension$"]

  actor {
provider = "akka.cluster.ClusterActorRefProvider"
serializers.java = "com.romix.akka.serialization.kryo.KryoSerializer"

serialization-bindings {
  // Classes that don't implement serializable list here one by one
  // to bind them to the Java serializer which you changed to Kryo.
  "io.vertx.core.json.JsonObject" = java
}

// I don't like to have too many threads so for non-blocking stuff I 
think N x CPU is enough where N = 1..4
default-dispatcher {
  type = Dispatcher
  executor = "fork-join-executor"

  fork-join-executor {
parallelism-min = 4
parallelism-factor = 1
parallelism-max = 8
  }
}

kryo {
  kryo-reference-map = false
  idstrategy = "automatic"
  use-manifests = true
  buffer-size = 1024
  type = "nograph"

  // To avoid serializing the class name list your remote message 
classes here:
  classes = [
"com.company.class_1",

"io.vertx.core.json.JsonObject",

"java.util.ArrayList"
  ]
}
  }

  // My current remote configuration, enough threads (not too many) for a 
cluster of up to 12 nodes
  remote {
log-remote-lifecycle-events = off

netty.tcp {
  port = 0

  server-socket-worker-pool {
pool-size-min = 4
pool-size-factor = 1
pool-size-max = 8
  }

  client-socket-worker-pool {
pool-size-min = 4
pool-size-factor = 1
pool-size-max = 8
  }
}

default-remote-dispatcher {
  type = Dispatcher
  executor = "fork-join-executor"

  fork-join-executor {
parallelism-min = 4
parallelism-factor = 1
parallelism-max = 8
  }
}
  }

  cluster {
metrics.enabled = off
jmx.enabled = off
  }
}

HTH,

Guido.

On Friday, September 9, 2016 at 8:43:39 AM UTC+1, silvio poma wrote:
>
> Hi Guys, Thanks a lot everybody. Yours tips were very useful and we are 
> working on it.
> We've already improved the router and the disptachers configuration 
> achieving very good results.
> Now we are trying to leave the java serialization and pass to another one 
> more efficient, but we are having some troubles in this field.
> Can some one point me any guides to follow? (Please notice that we are 
> writing in Java and not in Scala)  
> Thanks Guys,
> Silvio
>
> Il giorno mercoledì 7 settembre 2016 17:52:39 UTC+2, √ ha scritto:
>>
>> IMO Artery won't help much if using Java Serialization.
>> Java Serialization is notoriously slow.
>>
>> On Wed, Sep 7, 2016 at 5:50 PM, Guido Medina  wrote:
>>
>>> Artery is at  in milestone 3 (m3), you are welcome to use as I believe 
>>> it is in an extremely good shape but I would pursue both,
>>> as it will only require you a day of work (as a newbie) in configuration 
>>> and dependencies, no code changes will be required:
>>>
>>>
>>> http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-remote_2.11%7C2.4-ARTERY-M3%7Cjar
>>>
>>> As for dispatchers, be careful there, I didn't mean "one dispatcher per 
>>> actor" but more like "one dispatcher per one or more types of actors"
>>>
>>> HTH,
>>>
>>> Guido.
>>>
>>>
>>> On Wednesday, September 7, 2016 at 4:37:13 PM UTC+1, silvio poma wrote:

 Dear Guido,
 Thanks a lot for you answer. 
 We have already improved our concurrency model, using multiple 
 instances for each actor, that now work in parallel using multiple 
 dispatcher.
 Now we have not so much time to release our product to the client. 
 What do you suggest to focus our efforts on? 
 Which of this two arguments can effectively improve the system 
 efficiency?

 - Passing from Remote to Artery?
 - Remove Java serializer and use another one?

 Thanks,
 Looking forward to hear you.
 Silvio
   

 Il giorno mercoledì 7 settembre 2016 11:16:08 UTC+2, Guido Medina ha 
 scritto:
>
> Messages can be slow when being sent remotely from node A to node B,
> current Akka remote will give you a top of 100k msg/sec best scenario 
> and that depending on the message size,
> there is a new Akka remote (Akka artery which is a rewrite of Akka 
> remote) on the way so that shouldn't discourage you.
>
> Serialization is important, make sure you are not using the default 
> Java serialization, I suggest you to use Kryo for example.
>
> The fact that you are 

Re: [akka-user] GPU computing with akka

2016-09-09 Thread Zhaojie Niu
Dear Johan:

Thanks for your reply.

Does Akka team have any plans to support GPU?

在 2016年9月8日星期四 UTC+8下午10:08:32,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/msg/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+...@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] Data from tcp to a dynamically balanced stream does not work

2016-09-09 Thread Viktor Klang
Hi Ismail,

Please create a minimized, runnable code example, preferably with a test
that reproduces the situation.


On Fri, Sep 9, 2016 at 11:02 AM, Ismail Kelebek 
wrote:

> I have a problem while forwarding data received from tcp to a stream . It
> works with hardcoded version but does not work with dynamic balance graph .
> If i change the rtcpgraph with rtcpgraphdynamic, data does not flow into
> stream as if its run method is missing . Data arrives at publisher sink's
> materialized value (ret ), but does not continue further into stream. This
> dynamic graph works if i read data from file .
>
> val clsParallelPartialGraph = GraphDSL.create(){
> implicit builder =>
>
>
> val balance : UniformFanOutShape[(Array[Int]),(Array[Int
> ])] = builder.add(Balance[(Array[Int])](ParallelCount ))
>
>
> (0 until clsParallelCount).foreach { x =>
> balance ~> flowClusterings(x) ~>Sink.ignore
> }
>
>
> SinkShape(balance.in)
>  }
>  val connectionRet = connections.to(Sink.foreach { connection =>
>
>
> printOrNot(s"New connection from:
> ${connection.remoteAddress}")
> val sink1 = Sink.asPublisher[ByteString](fanout = true)
> val sourceTemp = Source.maybe[ByteString]
> val flowsinksource = Flow.fromSinkAndSourceMat(sink1,
> sourceTemp)(Keep.left)
>
>
>
>
> val ret : Publisher[ByteString] = connection.handleWith(
> flowsinksource )
>
>
> val sourcetcp = Source.fromPublisher(ret)
> .via(Framing.delimiter(
> ByteString("\n"),
> maximumFrameLength = 256,
> allowTruncation = true))
> .via(Flow[ByteString].map{x =>
> val decoded = x.decodeString("UTF-8")
> println("decoded :" + decoded)
> decoded
> })
>
>
> val rgraphtcp = RunnableGraph.fromGraph(GraphDSL.create(
> /*sinkToJsTuple*/){ implicit builder =>
> val balance : UniformFanOutShape[(Array[Int]),(Array[
> Int] )] = builder.add(Balance[(Array[Int])](ParallelCount ))
>
>
>
>
> sourcetcp ~>flow1tcp~> flow2 ~> flowMain ~>
> balance ~> flowClustering0 ~>Sink.ignore
> balance ~> flowClustering1 ~>Sink.ignore
> balance ~> flowClustering2 ~>Sink.ignore
>
>
> ClosedShape
> })
>
>
> val mattcp = rgraphtcp.run()
> /*
> val rgraphtcpdynamic = 
> RunnableGraph.fromGraph(GraphDSL.create(){
> implicit builder =>
> val balance : UniformFanOutShape[(Array[Int]),(Array[Int]
> )] = builder.add(Balance[(Array[Int] )](ParallelCount ))
>
>
> sourcetcp ~>flow1tcp~> flow2 ~> flowMain ~>
> clsParallelPartialGraph
>
>
> ClosedShape
> })
>
>
> val mattcp = rgraphtcpdynamic.run()
> */
>
>
> }).run
>
> --
> >> 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] Data from tcp to a dynamically balanced stream does not work

2016-09-09 Thread Ismail Kelebek
I have a problem while forwarding data received from tcp to a stream . It 
works with hardcoded version but does not work with dynamic balance graph . 
If i change the rtcpgraph with rtcpgraphdynamic, data does not flow into 
stream as if its run method is missing . Data arrives at publisher sink's 
materialized value (ret ), but does not continue further into stream. This 
dynamic graph works if i read data from file .

val clsParallelPartialGraph = GraphDSL.create(){
implicit builder =>


val balance : UniformFanOutShape[(Array[Int]),(Array[Int])] 
= builder.add(Balance[(Array[Int])](ParallelCount ))


(0 until clsParallelCount).foreach { x =>
balance ~> flowClusterings(x) ~>Sink.ignore
}


SinkShape(balance.in)
 }
 val connectionRet = connections.to(Sink.foreach { connection =>


printOrNot(s"New connection from: 
${connection.remoteAddress}")
val sink1 = Sink.asPublisher[ByteString](fanout = true)
val sourceTemp = Source.maybe[ByteString]
val flowsinksource = Flow.fromSinkAndSourceMat(sink1, 
sourceTemp)(Keep.left)




val ret : Publisher[ByteString] = 
connection.handleWith(flowsinksource 
)


val sourcetcp = Source.fromPublisher(ret)
.via(Framing.delimiter(
ByteString("\n"),
maximumFrameLength = 256,
allowTruncation = true))
.via(Flow[ByteString].map{x =>
val decoded = x.decodeString("UTF-8")
println("decoded :" + decoded) 
decoded
})


val rgraphtcp = RunnableGraph.fromGraph(GraphDSL.create(
/*sinkToJsTuple*/){ implicit builder =>
val balance : UniformFanOutShape[(Array[Int]),(Array[Int
] )] = builder.add(Balance[(Array[Int])](ParallelCount ))




sourcetcp ~>flow1tcp~> flow2 ~> flowMain ~>   
balance ~> flowClustering0 ~>Sink.ignore
balance ~> flowClustering1 ~>Sink.ignore
balance ~> flowClustering2 ~>Sink.ignore


ClosedShape
})


val mattcp = rgraphtcp.run()
/*
val rgraphtcpdynamic = 
RunnableGraph.fromGraph(GraphDSL.create(){ implicit builder =>
val balance : 
UniformFanOutShape[(Array[Int]),(Array[Int] )] = 
builder.add(Balance[(Array[Int] )](ParallelCount ))


sourcetcp ~>flow1tcp~> flow2 ~> flowMain ~> 
clsParallelPartialGraph


ClosedShape
})


val mattcp = rgraphtcpdynamic.run()
*/


}).run

-- 
>>  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 Multithreading on Akka-Cluster

2016-09-09 Thread silvio poma
Hi Guys, Thanks a lot everybody. Yours tips were very useful and we are 
working on it.
We've already improved the router and the disptachers configuration 
achieving very good results.
Now we are trying to leave the java serialization and pass to another one 
more efficient, but we are having some troubles in this field.
Can some one point me any guides to follow? (Please notice that we are 
writing in Java and not in Scala)  
Thanks Guys,
Silvio

Il giorno mercoledì 7 settembre 2016 17:52:39 UTC+2, √ ha scritto:
>
> IMO Artery won't help much if using Java Serialization.
> Java Serialization is notoriously slow.
>
> On Wed, Sep 7, 2016 at 5:50 PM, Guido Medina  > wrote:
>
>> Artery is at  in milestone 3 (m3), you are welcome to use as I believe it 
>> is in an extremely good shape but I would pursue both,
>> as it will only require you a day of work (as a newbie) in configuration 
>> and dependencies, no code changes will be required:
>>
>>
>> http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-remote_2.11%7C2.4-ARTERY-M3%7Cjar
>>
>> As for dispatchers, be careful there, I didn't mean "one dispatcher per 
>> actor" but more like "one dispatcher per one or more types of actors"
>>
>> HTH,
>>
>> Guido.
>>
>>
>> On Wednesday, September 7, 2016 at 4:37:13 PM UTC+1, silvio poma wrote:
>>>
>>> Dear Guido,
>>> Thanks a lot for you answer. 
>>> We have already improved our concurrency model, using multiple instances 
>>> for each actor, that now work in parallel using multiple dispatcher.
>>> Now we have not so much time to release our product to the client. 
>>> What do you suggest to focus our efforts on? 
>>> Which of this two arguments can effectively improve the system 
>>> efficiency?
>>>
>>> - Passing from Remote to Artery?
>>> - Remove Java serializer and use another one?
>>>
>>> Thanks,
>>> Looking forward to hear you.
>>> Silvio
>>>   
>>>
>>> Il giorno mercoledì 7 settembre 2016 11:16:08 UTC+2, Guido Medina ha 
>>> scritto:

 Messages can be slow when being sent remotely from node A to node B,
 current Akka remote will give you a top of 100k msg/sec best scenario 
 and that depending on the message size,
 there is a new Akka remote (Akka artery which is a rewrite of Akka 
 remote) on the way so that shouldn't discourage you.

 Serialization is important, make sure you are not using the default 
 Java serialization, I suggest you to use Kryo for example.

 The fact that you are using actors doesn't really mean you are using 
 concurrency right, books like "Java concurrency in Practice" still apply, 
 you need to know how dispatchers work in Akka
 and how to spread your actors among dispatcher for specialized tasks, 
 also, you need to learn how to create several instances of the same actor 
 so that they act as workers,
 hence activating a proper level of concurrency.

 I think the main problem is that *-it is a common mistake by new Akka 
 users-* is to try to just throw actors at the problem and expect that 
 it will magically solve concurrency issues.
 You need to read the documentation and understand how actors, routers 
 and dispatchers can work together and how to combine them.

 If you are simply sending messages to one actor in a node you still 
 have a single threaded kind processor,

 I have tackled this kind of problem by creating several instances *-say 
 N x CPUs depending on the problem they are solving-*,
 send such list to a remote node and there create a dumb round-robin 
 router and use such router to send messages to such pool of actors,
 and then you will have some decent concurrency in that node, make sure 
 you use more than one dispatcher or else everything will be executed by 
 the 
 same dispatcher,
 which translates to having a single thread pool executor doing 
 everything.

 http://doc.akka.io/docs/akka/2.4.10/java/dispatchers.html
 http://doc.akka.io/docs/akka/2.4.10/java/routing.html

 HTH,

 Guido.

 On Monday, September 5, 2016 at 11:58:47 AM UTC+1, silvio poma wrote:
>
> Dear Konrad,
> Thanks for your answer, our Actors didn't do anything that blocks the 
> system.
> One possible cause for our performance problem is that in our 
> "cluster-metrics-adaptive-group" router have just one routees associated 
> to 
> one actor (We have one actor for microsistem right now). We think to 
> increase the number of actor for each microsistem and consequencialy the 
> routees lists, is this a possible solution?
> If it is right to do so, there is a way to increase and decrease the 
> group without going directly inside the code, and leaves akka do so ?
> Thanks Silvio 
>
> Il giorno lunedì 5 settembre 2016 11:26:58 UTC+2, Konrad Malawski ha 
> scritto:
>>
>> This is not really enough 

Re: [akka-user] Akka Multithreading on Akka-Cluster

2016-09-09 Thread silvio poma
Hi Guys, Thanks a lot everybody. Your tips were very useful and we are 
working on it.
We've already improved the router and the disptachers configuration 
achieving very good results.
Now we are trying to leave the java serialization and pass to another one 
more efficient, but we are having some troubles in this field.
Can some one point me any guides to follow? (Please notice that we are 
writing in Java and not in Scala)  
Thanks Guys,
Silvio

Il giorno mercoledì 7 settembre 2016 17:52:39 UTC+2, √ ha scritto:
>
> IMO Artery won't help much if using Java Serialization.
> Java Serialization is notoriously slow.
>
> On Wed, Sep 7, 2016 at 5:50 PM, Guido Medina  > wrote:
>
>> Artery is at  in milestone 3 (m3), you are welcome to use as I believe it 
>> is in an extremely good shape but I would pursue both,
>> as it will only require you a day of work (as a newbie) in configuration 
>> and dependencies, no code changes will be required:
>>
>>
>> http://search.maven.org/#artifactdetails%7Ccom.typesafe.akka%7Cakka-remote_2.11%7C2.4-ARTERY-M3%7Cjar
>>
>> As for dispatchers, be careful there, I didn't mean "one dispatcher per 
>> actor" but more like "one dispatcher per one or more types of actors"
>>
>> HTH,
>>
>> Guido.
>>
>>
>> On Wednesday, September 7, 2016 at 4:37:13 PM UTC+1, silvio poma wrote:
>>>
>>> Dear Guido,
>>> Thanks a lot for you answer. 
>>> We have already improved our concurrency model, using multiple instances 
>>> for each actor, that now work in parallel using multiple dispatcher.
>>> Now we have not so much time to release our product to the client. 
>>> What do you suggest to focus our efforts on? 
>>> Which of this two arguments can effectively improve the system 
>>> efficiency?
>>>
>>> - Passing from Remote to Artery?
>>> - Remove Java serializer and use another one?
>>>
>>> Thanks,
>>> Looking forward to hear you.
>>> Silvio
>>>   
>>>
>>> Il giorno mercoledì 7 settembre 2016 11:16:08 UTC+2, Guido Medina ha 
>>> scritto:

 Messages can be slow when being sent remotely from node A to node B,
 current Akka remote will give you a top of 100k msg/sec best scenario 
 and that depending on the message size,
 there is a new Akka remote (Akka artery which is a rewrite of Akka 
 remote) on the way so that shouldn't discourage you.

 Serialization is important, make sure you are not using the default 
 Java serialization, I suggest you to use Kryo for example.

 The fact that you are using actors doesn't really mean you are using 
 concurrency right, books like "Java concurrency in Practice" still apply, 
 you need to know how dispatchers work in Akka
 and how to spread your actors among dispatcher for specialized tasks, 
 also, you need to learn how to create several instances of the same actor 
 so that they act as workers,
 hence activating a proper level of concurrency.

 I think the main problem is that *-it is a common mistake by new Akka 
 users-* is to try to just throw actors at the problem and expect that 
 it will magically solve concurrency issues.
 You need to read the documentation and understand how actors, routers 
 and dispatchers can work together and how to combine them.

 If you are simply sending messages to one actor in a node you still 
 have a single threaded kind processor,

 I have tackled this kind of problem by creating several instances *-say 
 N x CPUs depending on the problem they are solving-*,
 send such list to a remote node and there create a dumb round-robin 
 router and use such router to send messages to such pool of actors,
 and then you will have some decent concurrency in that node, make sure 
 you use more than one dispatcher or else everything will be executed by 
 the 
 same dispatcher,
 which translates to having a single thread pool executor doing 
 everything.

 http://doc.akka.io/docs/akka/2.4.10/java/dispatchers.html
 http://doc.akka.io/docs/akka/2.4.10/java/routing.html

 HTH,

 Guido.

 On Monday, September 5, 2016 at 11:58:47 AM UTC+1, silvio poma wrote:
>
> Dear Konrad,
> Thanks for your answer, our Actors didn't do anything that blocks the 
> system.
> One possible cause for our performance problem is that in our 
> "cluster-metrics-adaptive-group" router have just one routees associated 
> to 
> one actor (We have one actor for microsistem right now). We think to 
> increase the number of actor for each microsistem and consequencialy the 
> routees lists, is this a possible solution?
> If it is right to do so, there is a way to increase and decrease the 
> group without going directly inside the code, and leaves akka do so ?
> Thanks Silvio 
>
> Il giorno lunedì 5 settembre 2016 11:26:58 UTC+2, Konrad Malawski ha 
> scritto:
>>
>> This is not really enough information