Re: [akka-user] Save 2 snapshots at the same time?

2014-11-24 Thread Konrad Malawski
On Mon, Nov 24, 2014 at 5:50 AM, Soumya Simanta soumya.sima...@gmail.com
wrote:

 Also, doesn't snapshotting every message effectively means now your
 snapshot is your log/journal ?
 Please correct me if that is not correct.


That's more of a naming thing I'd say, but yes.

-- 
Cheers,
Konrad 'ktoso' Malawski
hAkker @ Typesafe

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Akka Persistence and Kryo serialization

2014-11-24 Thread Richard Bowker
Thank you for the suggestions, unfortunately no, setting it to default 
didn't seem to make any difference

On Friday, November 21, 2014 2:54:28 PM UTC, Konrad Malawski wrote:

 Hey guys,
 I just skimmed it, but it seems Evgeniy's suggestion should help.
 If you want it to be explicit you'd have to list all messages, including 
 ActorKilledException 
 in the classes section it seems...

 Let us know if that solved the problem - may be useful for other hakkers!

 On Fri, Nov 21, 2014 at 3:46 PM, Evgeniy Ostapenko sml...@gmail.com 
 javascript: wrote:

 idstrategy = default  

 четверг, 20 ноября 2014 г., 18:25:05 UTC+3 пользователь Richard Bowker 
 написал:

 I thought I'd experiment with using akka-kryo serializer to see what 
 difference it made to performance of persisting an event (defined by a 
 simple case class) compared to just allowing the default java serialization

 after trying to follow the instructions in here 
 https://github.com/romix/akka-kryo-serialization I am stuck.

 it appears to serialize the class I wanted (as I can see it in the 
 database), but on recovery of the actor I just get

 RecoveryFailure was caused by: com.esotericsoftware.kryo.KryoException: 
 Encountered unregistered class ID: 1636190130 (akka.actor.
 ActorKilledException)

 have I just got a setting wrong, or am I doing it all wrong! :)

 thank you!

 Rich


 here are the relevant sections of the application.conf..


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

 actor {
 serializers {  
 kryo = com.romix.akka.serialization.kryo.KryoSerializer  
 }   
  serialization-bindings {
 com.example.State$DomainEvent = kryo
 }
 }
 }

 kryo  {  
 # Possibles values for type are: graph or nograph  
 # graph supports serialization of object graphs with shared nodes  
 # and cyclic references, but this comes at the expense of a small 
 overhead  
 # nograph does not support object grpahs with shared nodes, but is 
 usually faster   
 type = nograph  


 # Possible values for idstrategy are:  
 # default, explicit, incremental  
 #  
 # default - slowest and produces bigger serialized representation. 
 Contains fully-  
 # qualified class names (FQCNs) for each class. Note that selecting 
 this strategy 
 # does not work in version 0.3.2, but is available on master and 
 from 0.3.3 onward.
 #  
 # explicit - fast and produces compact serialized representation. 
 Requires that all  
 # classes that will be serialized are pre-registered using the 
 mappings and classes
 # sections. To guarantee that both sender and receiver use the same 
 numeric ids for the same  
 # classes it is advised to provide exactly the same entries in the 
 mappings section   
 #  
 # incremental - fast and produces compact serialized representation. 
 Support optional  
 # pre-registering of classes using the mappings and classes 
 sections. If class is  
 # not pre-registered, it will be registered dynamically by picking a 
 next available id  
 # To guarantee that both sender and receiver use the same numeric 
 ids for the same   
 # classes it is advised to pre-register them using at least the 
 classes section   

 idstrategy = explicit  

 # Define a default size for serializer pool
 # Try to define the size to be at least as big as the max possible 
 number
 # of threads that may be used for serialization, i.e. max number
 # of threads allowed for the scheduler
 serializer-pool-size = 16

 # Define a default size for byte buffers used during serialization   
 buffer-size = 4096  

 # The serialization byte buffers are doubled as needed until they 
 exceed max-buffer-size and an exception is thrown. Can be -1 for no maximum.
 max-buffer-size = -1

 # If set, akka uses manifests to put a class name
 # of the top-level object into each message
 use-manifests = false

 # Enable transparent compression of serialized messages
 # accepted values are: off | lz4 | deflate
 compression = off

 # Log implicitly registered classes. Useful, if you want to know all 
 classes
 # which are serialized. You can then use this information in the 
 mappings and/or 
 # classes sections
 implicit-registration-logging = false 

 # If enabled, Kryo logs a lot of information about serialization 
 process.
 # Useful for debugging and lowl-level tweaking
 kryo-trace = true

 # If proviced, Kryo uses the class specified by a fully qualified 
 class name
 # to perform a custom initialization of Kryo instances in addition 
 to what
 # is done automatically based on the config file.
 #kryo-custom-serializer-init = CustomKryoSerializerInitFQCN

 # Define mappings from a fully qualified class name to a numeric id. 
  
 # Smaller ids lead to smaller sizes of serialized representations.  
 #  
 # This section is mandatory for 

[akka-user] Using Future with Actor Selection

2014-11-24 Thread Syd Gillani
Hi,

I was going through the Akka actorselection documents and as it describes 
that you can select and actor and send a reply to it. For instance

getContext().system().actorSelection(/actor/a).tell(result, 
getContext().self());

However, I was wondering if its possible in case of future as well. Does 
the system provide any name or path id's to the future request as well. 
Because according to my experiments, the future are assigned as a temporary 
actors with paths as ''/temp/$a''.  But if I use such path from an actor to 
reply back a future It just simple doesn't work.

My project have a master actor and various worker actors and I used future 
to get the aggregated result form the master. 

Thanks in advance.

Syd



-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Using Future with Actor Selection

2014-11-24 Thread Martynas Mickevičius
By future request you mean ask (?) pattern
http://doc.akka.io/docs/akka/2.3.7/scala/actors.html#Ask__Send-And-Receive-Future,
right?

If so, why do you want to complete the future by other means than replying
to the original message?

On Mon, Nov 24, 2014 at 12:37 PM, Syd Gillani s.zeeshangill...@gmail.com
wrote:

 Hi,

 I was going through the Akka actorselection documents and as it describes
 that you can select and actor and send a reply to it. For instance

 getContext().system().actorSelection(/actor/a).tell(result,
 getContext().self());

 However, I was wondering if its possible in case of future as well. Does
 the system provide any name or path id's to the future request as well.
 Because according to my experiments, the future are assigned as a temporary
 actors with paths as ''/temp/$a''.  But if I use such path from an actor to
 reply back a future It just simple doesn't work.

 My project have a master actor and various worker actors and I used future
 to get the aggregated result form the master.

 Thanks in advance.

 Syd



  --
  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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Martynas Mickevičius
Typesafe http://typesafe.com/ – Reactive
http://www.reactivemanifesto.org/ Apps on the JVM

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Save 2 snapshots at the same time?

2014-11-24 Thread Soumya Simanta


On Monday, November 24, 2014 3:29:33 AM UTC-5, Konrad Malawski wrote:


 On Mon, Nov 24, 2014 at 5:50 AM, Soumya Simanta soumya@gmail.com 
 javascript: wrote:

 Also, doesn't snapshotting every message effectively means now your 
 snapshot is your log/journal ? 
 Please correct me if that is not correct.


 That's more of a naming thing I'd say, but yes.


So in essence you can just read the latest message from the log/journal and 
there won't be a need to keep a snapshot. Correct?
 

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Save 2 snapshots at the same time?

2014-11-24 Thread Konrad 'ktoso' Malawski
A surprising way to use the Journal I’d say but yeah, it would work.

— k 

On 24 November 2014 at 12:23:35, Soumya Simanta (soumya.sima...@gmail.com) 
wrote:



On Monday, November 24, 2014 3:29:33 AM UTC-5, Konrad Malawski wrote:

On Mon, Nov 24, 2014 at 5:50 AM, Soumya Simanta soumya@gmail.com wrote:
Also, doesn't snapshotting every message effectively means now your snapshot is 
your log/journal ? 
Please correct me if that is not correct.

That's more of a naming thing I'd say, but yes.

So in essence you can just read the latest message from the log/journal and 
there won't be a need to keep a snapshot. Correct?
 
--
 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe
http://akka.io

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Reactive actor-actor communication

2014-11-24 Thread Adam Warski


 sorry it took my a while to get to this email - been consuming the least 
 responded / oldest email from the list throughout the week, not sure it 
 this worked well or not yet... :-)

no problem, it's open-source, no SLAs ;)
 

 By the way - isn't dropping demand messages a problem also in the current 
 remote-streams implementation?

 There is no remote akka streams yet.
 If you mean tcp then the demand is just generated by the socket - not 
 through passing tokens over the network.

ah I see, turns out I should have studied the code carefully (and TCP as 
well probably ;) )
 

 Right, well, originally I was wondering if Akka could replace 
 Kafka+Zookeeper's message streams (which can be used to implement the 
 scenario above: where there's a pool of producers, and a pool of consumers, 
 all potentially on different hosts, and using Kafka they can stream 
 messages reliably). With Kafka's delivery methods you bind each consumer to 
 a number of partitions, so it would be as you describe, kind of 
 point-to-point streams, which get re-balanced when a node goes down. 

 Going this route, there could be a cluster-singleton service which 
 assigns B-actors to A-actors, and creates streams between those two. These 
 could be the reactive message streams from above. And to solve the 
 demand-splitting problem (when a B has two As assigned), there could be 
 simply more consumer-actors then producer-actors.

 This sounds like a very interesting use case.
 Would be awesome if you could tinker around it. 

Random fact is that Kafka is *so much used everywhere* that it definitely 
 would find users/contributors I think :-)

great, always good to validate ideas :)

thanks,
Adam 

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Confusion about durable mailboxes superseded by akka-persistence?

2014-11-24 Thread Karthik Chandraraj
The reason why I used snapshot instead of persist message is, I need to 
remove the message from the queue on processing it.
In case of snapshot, I will just remove it from the linked queue and save 
the snapshot.
How can I achieve the same using persist message?

For ex:
Consider I have received the 5 messages
A,B,C,D,E and I have persisted them.

Now another actor is reading this queue and processing A, once it is done, 
I need to remove it from the queue.
How can I remove the persisted message A? so that after restart or jvm 
crash, I won't process the message again?


On Saturday, November 22, 2014 3:30:48 PM UTC+5:30, Akka Team wrote:

 Just use persist() to persist messages.
 Snapshotting should not be used for every message - it should be used once 
 in a while.

 — konrad
 ​

 On Fri, Nov 21, 2014 at 7:40 AM, Karthik Chandraraj ckart...@gmail.com 
 javascript: wrote:

 Hi,

 As per the suggestion, I implemented a QueueActor, which will 
 saveSnapshot for every message it receives or removed. And then a 
 ProcessActor, which will read the message from the QueueActor to process it.

 Is this the right way to implement durable mailbox with akka-persistence?
 Problem I see with this approach is, for every message, the data is 
 written to the file. Can we achieve durability only with this performance 
 hit?

 Thanks,
 C.Karthik


 On Thursday, November 13, 2014 7:58:01 PM UTC+5:30, Martynas Mickevičius 
 wrote:

 Hi Karthik,

 akka-persistence does not replace but supersede durable mailboxes. That 
 means if one wants to have an Actor that does not loose messages upon being 
 killed then sender must use AtLeastOnce delivery trait (or some other means 
 of durability with akka-persistence or not) to deliver messages to that 
 Actor.

 Let me know if that helped.

 On Wed, Nov 12, 2014 at 2:03 PM, Karthik Chandraraj ckart...@gmail.com 
 wrote:

 Consider there are 100 messages in the mailbox and the actor is 
 processing the first.
 If the process is killed, what happens to the 99 messages?

 When I was searching about this, I came across durable mailboxes, but 
 the doc says 'durable mailboxes superseded by akka-persistence'. 
 When I went though akka persistence, it said the actor state can be 
 persisted, it doesn't talk about mailboxes? using akka-persistence, actors 
 state can be stored, but what about messages that are in the mailbox and 
 not received?

 can someone please explain?

 -- 
  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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Martynas Mickevičius
 Typesafe http://typesafe.com/ – Reactive 
 http://www.reactivemanifesto.org/ Apps on the JVM
  
  -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Akka Team
 Typesafe - The software stack for applications that scale
 Blog: letitcrash.com
 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Confusion about durable mailboxes superseded by akka-persistence?

2014-11-24 Thread Konrad 'ktoso' Malawski
You don’t remove things in an event sourced application.
You mark as deleted.

A
B
C
DEL-A
DEL-B
D
DEL-C

— konrad

On 24 November 2014 at 14:08:37, Karthik Chandraraj (ckarthi...@gmail.com) 
wrote:

The reason why I used snapshot instead of persist message is, I need to remove 
the message from the queue on processing it.
In case of snapshot, I will just remove it from the linked queue and save the 
snapshot.
How can I achieve the same using persist message?

For ex:
Consider I have received the 5 messages
A,B,C,D,E and I have persisted them.

Now another actor is reading this queue and processing A, once it is done, I 
need to remove it from the queue.
How can I remove the persisted message A? so that after restart or jvm crash, I 
won't process the message again?


On Saturday, November 22, 2014 3:30:48 PM UTC+5:30, Akka Team wrote:
Just use persist() to persist messages.
Snapshotting should not be used for every message - it should be used once in a 
while.

— konrad


On Fri, Nov 21, 2014 at 7:40 AM, Karthik Chandraraj ckart...@gmail.com wrote:
Hi,

As per the suggestion, I implemented a QueueActor, which will saveSnapshot for 
every message it receives or removed. And then a ProcessActor, which will read 
the message from the QueueActor to process it.

Is this the right way to implement durable mailbox with akka-persistence?
Problem I see with this approach is, for every message, the data is written to 
the file. Can we achieve durability only with this performance hit?

Thanks,
C.Karthik


On Thursday, November 13, 2014 7:58:01 PM UTC+5:30, Martynas Mickevičius wrote:
Hi Karthik,

akka-persistence does not replace but supersede durable mailboxes. That means 
if one wants to have an Actor that does not loose messages upon being killed 
then sender must use AtLeastOnce delivery trait (or some other means of 
durability with akka-persistence or not) to deliver messages to that Actor.

Let me know if that helped.

On Wed, Nov 12, 2014 at 2:03 PM, Karthik Chandraraj ckart...@gmail.com wrote:
Consider there are 100 messages in the mailbox and the actor is processing the 
first.
If the process is killed, what happens to the 99 messages?

When I was searching about this, I came across durable mailboxes, but the doc 
says 'durable mailboxes superseded by akka-persistence'. 
When I went though akka persistence, it said the actor state can be persisted, 
it doesn't talk about mailboxes? using akka-persistence, actors state can be 
stored, but what about messages that are in the mailbox and not received?

can someone please explain?
--
 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Martynas Mickevičius
Typesafe – Reactive Apps on the JVM
--
 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe
http://akka.io

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

Re: [akka-user] Using Future with Actor Selection

2014-11-24 Thread Syd Gillani
Yeah by Future request I mean ask pattern.

Well the configuration of my actors is as following.

- Create Actor System

- Create Master and Send an Object for processing.

- Create Future and ask the Result form the Master 



Master will create various workers and then aggregate the result from them.

This aggregated result will be send to the Future.

So I would like to send the response back to Future when the aggregated 
result is computed in the Master


Syd








On Monday, 24 November 2014 11:52:28 UTC+1, Martynas Mickevičius wrote:

 By future request you mean ask (?) pattern 
 http://doc.akka.io/docs/akka/2.3.7/scala/actors.html#Ask__Send-And-Receive-Future,
  
 right?

 If so, why do you want to complete the future by other means than replying 
 to the original message?

 On Mon, Nov 24, 2014 at 12:37 PM, Syd Gillani s.zeesha...@gmail.com 
 javascript: wrote:

 Hi,

 I was going through the Akka actorselection documents and as it describes 
 that you can select and actor and send a reply to it. For instance

 getContext().system().actorSelection(/actor/a).tell(result, 
 getContext().self());

 However, I was wondering if its possible in case of future as well. Does 
 the system provide any name or path id's to the future request as well. 
 Because according to my experiments, the future are assigned as a temporary 
 actors with paths as ''/temp/$a''.  But if I use such path from an actor to 
 reply back a future It just simple doesn't work.

 My project have a master actor and various worker actors and I used 
 future to get the aggregated result form the master. 

 Thanks in advance.

 Syd



  -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Martynas Mickevičius
 Typesafe http://typesafe.com/ – Reactive 
 http://www.reactivemanifesto.org/ Apps on the JVM
  

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Reactive actor-actor communication

2014-11-24 Thread Adam Warski


 By the way - isn't dropping demand messages a problem also in the current 
 remote-streams implementation?

 There is no remote akka streams yet.
 If you mean tcp then the demand is just generated by the socket - not 
 through passing tokens over the network.


So as I understand back-pressure is implemented as described here: 
http://doc.akka.io/docs/akka/2.3.7/scala/io-tcp.html (with propagation to 
the writer side by using TCP buffers), right? If the subscriber doesn't 
generate demand, this will result in suspending reading from the socket?

Adam
 

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Akka clusterclient Association Error / ClassNotFoundException when serialising response

2014-11-24 Thread Hengky Sucanda
Hi Martynas,

Yes the class (without the dollar sign) is in the classpath. It is actually 
in another project that i made to depends on the frontend and backend

On Thursday, November 13, 2014 6:35:08 PM UTC+7, Martynas Mickevičius wrote:

 Hi Hengky,

 could you make sure that Acknowledged$ class is in the classpath of the 
 node where you see this error?

 On Mon, Nov 10, 2014 at 1:30 PM, Hengky Sucanda greglu...@gmail.com 
 javascript: wrote:

 Hi Everyone!

 I have been trying to implement akka clustering and sharding with 
 persistent actor, i seperated the projects in 3 projects (*api, backend, 
 and frontend*). I started 2 backend nodes with different ports, and one 
 frontend cluster. I use cluster client in the frontend side, the command 
 was able to be sent to the backend but i cannot get any message back (it is 
 supposed to send an acknowledgment message back). Here is the error log

 [ERROR] [11/10/2014 18:22:21.468] 
 [se3-actor-system-akka.remote.default-remote-dispatcher-6] [akka.tcp://
 se3-actor-system@127.0.0.1:51599/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fse3-actor-system%40127.0.0.1%3A2552-1/endpointWriter]
  
 AssociationError [akka.tcp://se3-actor-system@127.0.0.1:51599] - 
 [akka.tcp://se3-actor-system@127.0.0.1:2552]: Error 
 [com.icehousecorp.common.support.domain.protocol.Acknowledged$] [
 java.lang.ClassNotFoundException: 
 com.icehousecorp.common.support.domain.protocol.Acknowledged$
 at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:340)
 at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626)
 at 
 akka.util.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.scala:19)
 at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
 at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
 at 
 java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
 at 
 akka.serialization.JavaSerializer$$anonfun$1.apply(Serializer.scala:136)
 at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
 at akka.serialization.JavaSerializer.fromBinary(Serializer.scala:136)
 at 
 akka.serialization.Serialization$$anonfun$deserialize$1.apply(Serialization.scala:104)
 at scala.util.Try$.apply(Try.scala:191)
 at akka.serialization.Serialization.deserialize(Serialization.scala:98)
 at akka.remote.MessageSerializer$.deserialize(MessageSerializer.scala:23)
 at 
 akka.remote.DefaultMessageDispatcher.payload$lzycompute$1(Endpoint.scala:58)
 at akka.remote.DefaultMessageDispatcher.payload$1(Endpoint.scala:58)
 at akka.remote.DefaultMessageDispatcher.dispatch(Endpoint.scala:76)
 at 
 akka.remote.EndpointReader$$anonfun$receive$2.applyOrElse(Endpoint.scala:937)
 at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
 at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:415)
 at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
 at akka.actor.ActorCell.invoke(ActorCell.scala:487)
 at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
 at akka.dispatch.Mailbox.run(Mailbox.scala:220)
 at 
 akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
 at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
 at 
 scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 at 
 scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
 at 
 scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
 ]
 [WARN] [11/10/2014 18:22:21.471] 
 [se3-actor-system-akka.remote.default-remote-dispatcher-5] [akka.tcp://
 se3-actor-system@127.0.0.1:51599/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fse3-actor-system%40127.0.0.1%3A2552-1]
  
 Association with remote system [akka.tcp://
 se3-actor-system@127.0.0.1:2552] has failed, address is now gated for 
 [5000] ms. Reason is: 
 [com.icehousecorp.common.support.domain.protocol.Acknowledged$].

 This file (com.icehousecorp.common.support.domain.protocol.Acknowledged) 
 is located at the API project and the frontend project depends on the APi 
 project (in the build.sbt).

 Can anyone help me out why it throws error even though i have made it 
 depends on the required project?

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

[akka-user] type mismatch when using pipeTo pattern in Route while parsing entity

2014-11-24 Thread Yoel R GARCIA DIAZ
I have the following routes

def routes: Route =
path(Segment) { cmd = 
get { requestContext =
val request = CMD(command = cmd, params = Nil: List[String])
val responder = createResponder(requestContext)
batcApi.ask(request).pipeTo(responder)
} ~
   post { requestContext =
val request = CMD(command = cmd, params = Nil: List[String])
 val responder = createResponder(requestContext)
 batcApi.ask(request).pipeTo(responder)
}
}

The GET and POST requests work perfectly as expected however, when I try to 
parse the entity in the POST body I get type mismatch

def routes: Route =
path(Segment) { cmd = 
get { requestContext =
val request = CMD(command = cmd, params = Nil: List[String])
val responder = createResponder(requestContext)
batcApi.ask(request).pipeTo(responder)
} ~
   post { requestContext =
entity(as[JsParams]) { params =
   val request = CMD(command = cmd, params = Nil: List[String])
val responder = createResponder(requestContext)
batcApi.ask(request).pipeTo(responder)
}
}
}

This is the error: 

type mismatch;

[error]  found   : scala.concurrent.Future[Any]

[error]  required: spray.routing.RequestContext = Unit

[error] batcApi.ask(request).pipeTo(responder)

[error]  ^

[error] one error found

It seems that I can't use the pipeTo pattern inside the block. Does anyone 
know how to work around this? I appreciate any help. Thanks!

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


[akka-user] Akka Streams documentation and examples

2014-11-24 Thread Soumya Simanta
Can someone point to documentation and examples for Akka Streams. 

Thanks
-Soumya

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Akka Streams documentation and examples

2014-11-24 Thread Piyush Mishra
Visit akka.io

Piyush Mishra
*Blog* https://www.linkedin.com/in/piyush1989 | *LinkedIn
https://www.linkedin.com/in/piyush1989*

Skype : piyush.mishra275
Hangout :piyushmishra889
Mobile : +91-8860876875

On Tue, Nov 25, 2014 at 11:38 AM, Soumya Simanta soumya.sima...@gmail.com
wrote:

 Can someone point to documentation and examples for Akka Streams.

 Thanks
 -Soumya

  --
  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 http://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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Akka Streams documentation and examples

2014-11-24 Thread Soumya Simanta
I tried this, but cannot find anything there. 
http://doc.akka.io/docs/akka-stream-and-http-experimental/0.11/scala.html?_ga=1.67564625.1938417986.1393726085



On Tuesday, November 25, 2014 1:09:46 AM UTC-5, Piyush Mishra wrote:

 Visit akka.io

 Piyush Mishra
 *Blog* https://www.linkedin.com/in/piyush1989 | *LinkedIn 
 https://www.linkedin.com/in/piyush1989*

 Skype : piyush.mishra275
 Hangout :piyushmishra889
 Mobile : +91-8860876875

 On Tue, Nov 25, 2014 at 11:38 AM, Soumya Simanta soumya@gmail.com 
 javascript: wrote:

 Can someone point to documentation and examples for Akka Streams. 

 Thanks
 -Soumya

  -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] AKKA KRYO causing cluster node unregister

2014-11-24 Thread neeraj negi
Hi,

I have tried with `default` id generation strategy
Below are the logs that i am getting. It's a null pointer exception but I 
am sending only hashmap and a long variable inside the RecordNewMessage


2014-11-25 12:37:56 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Metrics will be retreived from 
MBeans, and may be incorrect on some platforms. To increase metric accuracy 
add the 'sigar.jar' to the classpath and the appropriate platform-specific 
native libary to 'java.library.path'. Reason: 
java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar
2014-11-25 12:37:56 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Metrics collection has started 
successfully
2014-11-25 12:37:56 INFO  LocalActorRef:74 - Message 
[akka.dispatch.sysmsg.Terminate] from 
Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess-1#-864068775]
 
to 
Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess-1#-864068775]
 
was not delivered. [1] dead letters encountered. This logging can be turned 
off or adjusted with configuration settings 'akka.log-dead-letters' and 
'akka.log-dead-letters-during-shutdown'.
2014-11-25 12:37:56 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] is JOINING, roles 
[fileconsumernode]
2014-11-25 12:37:57 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] to [Up]
2014-11-25 12:38:01 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Node 
[akka.tcp://ClusterSystem@127.0.0.1:2552] is JOINING, roles 
[filetransformernode]
2014-11-25 12:38:01 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2552] - Welcome from 
[akka.tcp://ClusterSystem@127.0.0.1:2551]
transformer node Added
2014-11-25 12:38:02 INFO  Cluster(akka://ClusterSystem):74 - Cluster Node 
[akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node 
[akka.tcp://ClusterSystem@127.0.0.1:2552] to [Up]
actor selection string is 
akka.tcp://ClusterSystem@127.0.0.1:2552/user/filetransformernode
process Message
actor selection string is 
akka.tcp://ClusterSystem@127.0.0.1:2552/user/filetransformernode
2014-11-25 12:38:04 ERROR EndpointWriter:65 - AssociationError 
[akka.tcp://ClusterSystem@127.0.0.1:2552] - 
[akka.tcp://ClusterSystem@127.0.0.1:2551]: Error 
[java.lang.NullPointerException
Serialization trace:
header (com.xyz.message.RecordNewMessage)] [
com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
Serialization trace:
header (com.xyz.message.RecordNewMessage)
at 
com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at 
com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:528)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:761)
at 
com.romix.akka.serialization.kryo.KryoBasedSerializer.fromBinary(KryoSerializer.scala:394)
at 
com.romix.akka.serialization.kryo.KryoSerializer.fromBinary(KryoSerializer.scala:239)
at 
akka.serialization.Serialization$$anonfun$deserialize$1.apply(Serialization.scala:104)
at scala.util.Try$.apply(Try.scala:161)
at akka.serialization.Serialization.deserialize(Serialization.scala:98)
at 
akka.remote.serialization.MessageContainerSerializer.fromBinary(MessageContainerSerializer.scala:63)
at 
akka.serialization.Serialization$$anonfun$deserialize$1.apply(Serialization.scala:104)
at scala.util.Try$.apply(Try.scala:161)
at akka.serialization.Serialization.deserialize(Serialization.scala:98)
at akka.remote.MessageSerializer$.deserialize(MessageSerializer.scala:23)
at 
akka.remote.DefaultMessageDispatcher.payload$lzycompute$1(Endpoint.scala:58)
at akka.remote.DefaultMessageDispatcher.payload$1(Endpoint.scala:58)
at akka.remote.DefaultMessageDispatcher.dispatch(Endpoint.scala:76)
at 
akka.remote.EndpointReader$$anonfun$receive$2.applyOrElse(Endpoint.scala:937)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:415)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at 
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
at 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: java.lang.NullPointerException
at java.util.HashMap.put(HashMap.java:497)
at 

Re: [akka-user] AKKA KRYO causing cluster node unregister

2014-11-24 Thread neeraj negi
Hi,

Yes I am using the same configuration of application.conf in both nodes.

I have tried with 'default' id generation strategy but againg receiving 
node becomes unrechable.


Now i have created the small application with two nodes one sending and one 
receiving

kryo logs  is running on both nodes. kryo is reading on receiving sides but 
its failing somehow because its not coming on my onReceive() method but 
logs are prining

logs on receiving side:--



00:50 TRACE: [kryo] Read class 26: java.util.HashMap
00:50 TRACE: [kryo] Read initial object reference 1: java.util.HashMap
00:50 TRACE: [kryo] Read initial object reference 2: String
00:50 TRACE: [kryo] Read: second
00:50 TRACE: [kryo] Read class 1: String
00:50 TRACE: [kryo] Read initial object reference 3: String
00:50 TRACE: [kryo] Read: second object
00:50 TRACE: [kryo] Object graph complete.



where i am doing wrong???/

please help m struck



On Saturday, November 22, 2014 3:24:11 PM UTC+5:30, Akka Team wrote:

 Are both nodes configured to use kryo?
 What's the error you're getting?
 Try `default` id generation strategy, like mentioned in another thread 
 this week.

 --konrad

 On Thu, Nov 20, 2014 at 7:06 PM, neeraj negi negi.ne...@gmail.com 
 javascript: wrote:

 Hi,

 I have two node system which was working fine till i have added the kryo.

 Attached file is the application.conf that i am using.

 KRYO causing the other node unregistered.

 do i need to change something in the configuration


  -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Akka Team
 Typesafe - The software stack for applications that scale
 Blog: letitcrash.com
 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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] remote akka problem - not able to communicate

2014-11-24 Thread Suman Adak
Dear All,

I have some problem with remote akka. 

I'm trying to create one akka remote actor node and connect it from a 
different machine. I opened 
the port 2551,2552,2553 ports of both the machines. But after creating the 
remote actor in one machine I'm 
not able to access it from the other machine. Even I'm not able to access 
the process via TELNET, but in NETSTAT the 
process reviels its running status in port 2551.

Please help me ..I am pasting my code snippet along with this mail... 

My code snipet for machine A(remote):
_

1. Conf file:

akka {
  actor {
provider = akka.remote.RemoteActorRefProvider
   }
   remote {
 transport = akka.remote.netty.NettyRemoteTransport
 netty.tcp {
   hostname = 192.168.161.131
   port = 2551
 }
   }
}

2. Code:

import akka.actor._
import com.typesafe.config.ConfigFactory
import java.io.File
import com.typesafe.config.ConfigParseOptions

object HelloRemote  {
  def main(args: Array[String]): Unit = {
  val rootCfg = ConfigFactory.parseFile(new File(./test/remote.conf), 
ConfigParseOptions.defaults())
  val system = ActorSystem(HelloRemoteSystem, rootCfg)
  val remoteActor = system.actorOf(Props[RemoteActor], name = RemoteActor)
  remoteActor ! The RemoteActor is alive
  }
}

class RemoteActor extends Actor {
  def receive = {
case msg: String =
println(sRemoteActor received message '$msg')
sender ! Hello from the RemoteActor
  }
}




My code snipet for machine B(Local):

1. Conf file:

akka {
  actor {
provider = akka.remote.RemoteActorRefProvider
  }
  remote {
transport = akka.remote.netty.NettyRemoteTransport
netty.tcp {
  hostname = 192.168.161.222
  port = 2551
}
  }
}


2. Code:

import akka.actor._
import com.typesafe.config.ConfigFactory
import java.io.File
import com.typesafe.config.ConfigParseOptions

object Local {
  def main(args: Array[String]): Unit = {
  val rootCfg = ConfigFactory.parseFile(new File(./test/local.conf), 
ConfigParseOptions.defaults())
  implicit val system = ActorSystem(LocalSystem, rootCfg)
  val localActor = system.actorOf(Props[LocalActor], name = LocalActor) 
 // the local actor
  localActor ! START 
// start the action
  }
}

class LocalActor extends Actor {

  // create the remote actor
  val remote = 
context.actorSelection(akka.tcp://HelloRemoteSystem@192.168.161.131:2551/user/RemoteActor)
  var counter = 0

  def receive = {
case START =
remote.tell(hi)
remote ! Hello from the LocalActor
case msg: String =
println(sLocalActor received message: '$msg')
if (counter  5) {
sender ! Hello back to you
counter += 1
}
  }
}


-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] testing akka cluster on Blue Waters @ NCSA

2014-11-24 Thread Nidhi
Hello all, we are working on a course project to simulate twitter server 
and twitter users and test the server for the load it can handle. We have 
users on one system (with one client master and around 10,000 user actors) 
and server on another machine(one master and 1000 worker actors) to resolve 
the queries it gets from the user actors remotely. We are sending an 
average of 6000 queries/sec to the server. We have one TCP connection 
between the 2 systems and we get the following warning 

[TwitterServerSystem-akka.remote.default-remote-dispatcher-6] [akka.tcp://
TwitterServerSystem@122.122.122.122:2552/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FTwitterClientSystem%40127.0.0.1%3A56833-0/endpointWriter
 
http://www.google.com/url?q=http%3A%2F%2FTwitterServerSystem%4010.136.43.158%3A52335%2Fsystem%2FendpointManager%2FreliableEndpointWriter-akka.tcp%253A%252F%252FTwitterClientSystem%2540127.0.0.1%253A56833-0%2FendpointWritersa=Dsntz=1usg=AFQjCNFv8cFbjN-nkft3bH--gLuNWbbdVQ]
 
[65138] buffered messages in EndpointWriter for [akka.tcp://
TwitterClientSystem@127.0.0.1:56833 
http://www.google.com/url?q=http%3A%2F%2FTwitterClientSystem%40127.0.0.1%3A56833sa=Dsntz=1usg=AFQjCNHDGGNE6uGCLY9WRq5G-oSxo0FaGQ].
 
You should probably implement flow control to avoid flooding the remote 
connection.

Just came across this thread and thought it is relevant to our problem. We 
know since we have one tcp connection(can we increase the number of 
connections?), it might be a bottleneck. Both the server and client 
machines buffer messages for each other. 

How do we go about using this new fix ?

Thank you.

Regards,
Nidhi

On Friday, April 25, 2014 9:48:55 AM UTC-4, Patrik Nordwall wrote:

 Boris, you should try the timestamped snapshot 2.3-20140425-151510 that is 
 published to repo http://repo.akka.io/snapshots/

 It is supposed to handle bursts of many messages without (much) degraded 
 throughput or false failure detection. More details here: 
 https://groups.google.com/d/msg/akka-dev/mFvz_d737t4/pZSmbFRLAV8J

 Regards,
 Patrik

 On Mon, Mar 24, 2014 at 5:00 PM, √iktor Ҡlang viktor...@gmail.com 
 javascript: wrote:

 Nice!


 On Mon, Mar 24, 2014 at 4:55 PM, Boris Capitanu bor...@gmail.com 
 javascript: wrote:

 Anyway, one thing to try is to set akka.remote.backoff-interval to a 
 larger value while setting the send-buffer-size to 1024000b. I would 
 try with backoffs 0.5s and 1s. While 1s is not a very good setting, it is 
 a 
 good way to test our hypothesis.
  

 I've used the backoff-interval = 0.5s and send-buffer-size=1024000b and 
 I do see the timings becoming more consistent (albeit worse).  
 The standard deviation of the timings observed is much lower.

 Well - I think we narrowed down the issue.  I'll wait for a fix...  I'll 
 be glad to test any nightly builds that include a fix if it would be 
 helpful.

 -Boris

 -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Cheers,
 √

 * ——— **Viktor Klang*
 *Chief Architect - **Typesafe http://www.typesafe.com/*

  Twitter: @viktorklang
  
 -- 
  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 javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 -- 

 Patrik Nordwall
 Typesafe http://typesafe.com/ -  Reactive apps on the JVM
 Twitter: @patriknw
 JOIN US. REGISTER TODAY! http://www.scaladays.org/
 Scala http://www.scaladays.org/
 Days http://www.scaladays.org/
 June 16th-18th, http://www.scaladays.org/
 Berlin http://www.scaladays.org/

 

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

Re: [akka-user] AKKA cluster remoting taking time

2014-11-24 Thread neeraj negi
Yes now I am shifted to use kryo but its not working. below is my 
applicatin .conf
kindly help because m struck on kryo :(

akka {
extensions = [com.romix.akka.serialization.kryo.KryoSerializationExtension$]
event-handlers = 
[akka.event.slf4j.Slf4jEventHandler,com.typesafe.atmos.trace.Slf4jTraceContextEventHandler]
 
  loggers = [akka.event.slf4j.Slf4jLogger]
  loglevel = ERROR

  actor {
provider = akka.cluster.ClusterActorRefProvider
serializers {
# Define kryo serializer   
kryo = 
com.romix.akka.serialization.kryo.KryoSerializer
}

 serialization-bindings {
java.util.List = kryo
java.io.Serializable = kryo
java.util.Map = kryo
akka.remote.message.Message = kryo
} 

kryo  {  
# Possibles values for type are: graph or nograph  
# graph supports serialization of object graphs with shared nodes  
# and cyclic references, but this comes at the expense of a small overhead  
# nograph does not support object grpahs with shared nodes, but is usually 
faster   
type = graph  


# Possible values for idstrategy are:  
# default, explicit, incremental  
#  
# default - slowest and produces bigger serialized representation. Contains 
fully-  
# qualified class names (FQCNs) for each class. Note that selecting this 
strategy 
# does not work in version 0.3.2, but is available on master and from 0.3.3 
onward.
#  
# explicit - fast and produces compact serialized representation. Requires 
that all  
# classes that will be serialized are pre-registered using the mappings 
and classes
# sections. To guarantee that both sender and receiver use the same numeric 
ids for the same  
# classes it is advised to provide exactly the same entries in the 
mappings section   
#  
# incremental - fast and produces compact serialized representation. 
Support optional  
# pre-registering of classes using the mappings and classes sections. 
If class is  
# not pre-registered, it will be registered dynamically by picking a next 
available id  
# To guarantee that both sender and receiver use the same numeric ids for 
the same   
# classes it is advised to pre-register them using at least the classes 
section   

idstrategy = incremental  

# Define a default size for serializer pool
# Try to define the size to be at least as big as the max possible number
# of threads that may be used for serialization, i.e. max number
# of threads allowed for the scheduler
serializer-pool-size = 16

# Define a default size for byte buffers used during serialization   
buffer-size = 4096  

# The serialization byte buffers are doubled as needed until they exceed 
max-buffer-size and an exception is thrown. Can be -1 for no maximum.
max-buffer-size = -1

# If set, akka uses manifests to put a class name
# of the top-level object into each message
use-manifests = false

# Enable transparent compression of serialized messages
# accepted values are: off | lz4 | deflate
compression = off

# Log implicitly registered classes. Useful, if you want to know all classes
# which are serialized. You can then use this information in the mappings 
and/or 
# classes sections
implicit-registration-logging = false 

# If enabled, Kryo logs a lot of information about serialization process.
# Useful for debugging and lowl-level tweaking
kryo-trace = false 

# If proviced, Kryo uses the class specified by a fully qualified class name
# to perform a custom initialization of Kryo instances in addition to what
# is done automatically based on the config file.
#kryo-custom-serializer-init = CustomKryoSerializerInitFQCN

# Define mappings from a fully qualified class name to a numeric id.  
# Smaller ids lead to smaller sizes of serialized representations.  
#  
# This section is mandatory for idstartegy=explciit  
# This section is optional  for idstartegy=incremental  
# This section is ignored   for idstartegy=default  
#   
# The smallest possible id should start at 20 (or even higher), because
# ids below it are used by Kryo internally e.g. for built-in Java and 
# Scala types   
mappings {  
   # akka.remote.message.Message = 20
}  


# If enabled, Kryo uses internally a map detecting shared nodes.
# This is a preferred mode for big object graphs with a 
lot of nodes.
# For small object graphs (e.g. below 10 nodes) set it 
to false for 
# better performance. 
kryo-reference-map = true 

  
# Define a set of fully qualified 

Re: [akka-user] testing akka cluster on Blue Waters @ NCSA

2014-11-24 Thread Patrik Nordwall
On Mon, Nov 24, 2014 at 1:32 AM, Nidhi nidhi.ashwani.aggar...@gmail.com
wrote:

 Hello all, we are working on a course project to simulate twitter server
 and twitter users and test the server for the load it can handle. We have
 users on one system (with one client master and around 10,000 user actors)
 and server on another machine(one master and 1000 worker actors) to resolve
 the queries it gets from the user actors remotely. We are sending an
 average of 6000 queries/sec to the server. We have one TCP connection
 between the 2 systems and we get the following warning

 [TwitterServerSystem-akka.remote.default-remote-dispatcher-6] [akka.tcp://
 TwitterServerSystem@122.122.122.122:2552/system/endpointManager/
 reliableEndpointWriter-akka.tcp%3A%2F%2FTwitterClientSystem%40127.0.
 0.1%3A56833-0/endpointWriter
 http://www.google.com/url?q=http%3A%2F%2FTwitterServerSystem%4010.136.43.158%3A52335%2Fsystem%2FendpointManager%2FreliableEndpointWriter-akka.tcp%253A%252F%252FTwitterClientSystem%2540127.0.0.1%253A56833-0%2FendpointWritersa=Dsntz=1usg=AFQjCNFv8cFbjN-nkft3bH--gLuNWbbdVQ]
 [65138] buffered messages in EndpointWriter for [akka.tcp://
 TwitterClientSystem@127.0.0.1:56833
 http://www.google.com/url?q=http%3A%2F%2FTwitterClientSystem%40127.0.0.1%3A56833sa=Dsntz=1usg=AFQjCNHDGGNE6uGCLY9WRq5G-oSxo0FaGQ].
 You should probably implement flow control to avoid flooding the remote
 connection.



This warning indicates that many remote messages have been queued on the
sender side. It is configured by:

# Log warning if the number of messages in the backoff buffer in the
endpoint

# writer exceeds this limit. It can be disabled by setting the value to
off.

akka.remote.log-buffer-size-exceeding = 5

The recommendation about flow control means that you should add some
application level protocol (messages) between sender and receiver that
controls how much the sender is allowed to produce before it stops sending
more. Without that you will get out of memory if the sender continues to
produce faster than what can be consumed.


 Just came across this thread and thought it is relevant to our problem. We
 know since we have one tcp connection(can we increase the number of
 connections?), it might be a bottleneck. Both the server and client
 machines buffer messages for each other.

 How do we go about using this new fix ?


The improvements for sending bursts of remote messages have been included
in Akka 2.3.x since 2.3.3.

Regards,
Patrik



 Thank you.

 Regards,
 Nidhi

 On Friday, April 25, 2014 9:48:55 AM UTC-4, Patrik Nordwall wrote:

 Boris, you should try the timestamped snapshot 2.3-20140425-151510 that
 is published to repo http://repo.akka.io/snapshots/

 It is supposed to handle bursts of many messages without (much) degraded
 throughput or false failure detection. More details here:
 https://groups.google.com/d/msg/akka-dev/mFvz_d737t4/pZSmbFRLAV8J

 Regards,
 Patrik

 On Mon, Mar 24, 2014 at 5:00 PM, √iktor Ҡlang viktor...@gmail.com
 wrote:

 Nice!


 On Mon, Mar 24, 2014 at 4:55 PM, Boris Capitanu bor...@gmail.com
 wrote:

 Anyway, one thing to try is to set akka.remote.backoff-interval to a
 larger value while setting the send-buffer-size to 1024000b. I would
 try with backoffs 0.5s and 1s. While 1s is not a very good setting, it is 
 a
 good way to test our hypothesis.


 I've used the backoff-interval = 0.5s and send-buffer-size=1024000b and
 I do see the timings becoming more consistent (albeit worse).
 The standard deviation of the timings observed is much lower.

 Well - I think we narrowed down the issue.  I'll wait for a fix...
 I'll be glad to test any nightly builds that include a fix if it would be
 helpful.

 -Boris

 --
  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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 √

 * ——— **Viktor Klang*
 *Chief Architect - **Typesafe http://www.typesafe.com/*

  Twitter: @viktorklang

 --
  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 http://groups.google.com/group/akka-user.
 For more options, visit