[akka-user] Correct way to model a Redis subscriber as Akka actor(s)

2014-03-23 Thread Soumya Simanta

I'm crosspointing it here to get wider coverage. 

http://stackoverflow.com/questions/22569664/correct-way-to-model-a-subscriber-as-an-akka-actor

I'm planning to reengineer an existing system to use Akka, Play and 
Websockets.

My current system is based on Jetty and Websockets.

I've a fast stream of messages that are published into a Redis channel. In 
my web app layer I subscribe to these messages using a Jedis subscriber and 
then push those messages to a Websocket which are then displayed on a 
browser.

I want to make the shift two two primary reason - a) better and simpler 
fault tolerance due to use of Actors b) the ability to connect to multiple 
streams using different actors

In my current design I've a supervisor that creates a new child actor for 
every new channel. The child actor then subscribes to a Redis channel. My 
question what's the best way to push the messages (received from the Redis 
channel) to a Play Websocket ?

-- 
  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] Correct way to model a Redis subscriber as Akka actor(s)

2014-03-23 Thread Patrik Nordwall


 23 mar 2014 kl. 03:48 skrev Soumya Simanta soumya.sima...@gmail.com:
 
 
 I'm crosspointing it here to get wider coverage. 
 
 http://stackoverflow.com/questions/22569664/correct-way-to-model-a-subscriber-as-an-akka-actor
 
 I'm planning to reengineer an existing system to use Akka, Play and 
 Websockets.
 
 My current system is based on Jetty and Websockets.
 
 I've a fast stream of messages that are published into a Redis channel. In my 
 web app layer I subscribe to these messages using a Jedis subscriber and then 
 push those messages to a Websocket which are then displayed on a browser.
 
 I want to make the shift two two primary reason - a) better and simpler fault 
 tolerance due to use of Actors b) the ability to connect to multiple streams 
 using different actors
 
 In my current design I've a supervisor that creates a new child actor for 
 every new channel. The child actor then subscribes to a Redis channel. My 
 question what's the best way to push the messages (received from the Redis 
 channel) to a Play Websocket ?
 
You will find description and code for how to do that in the Reactive Maps 
Typesafe Activator tutorial: 
https://typesafe.com/activator/template/reactive-maps

Cheers,
Patrik
 -- 
  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-camel sending email with attachment

2014-03-23 Thread Raymond Roestenburg
There is no support yet for attachments in akka-camel. There is already a
ticket for it: https://www.assembla.com/spaces/akka/tickets/1214
I'm planning to start working on this (finally) this week.


On Sat, Mar 22, 2014 at 9:28 PM, Zlatko Josic zlatko.jo...@gmail.comwrote:

 Hi,

 Is there any example how to send an email with an attachment in akka-camel?

 Thanks

 Zlaja

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




-- 
Raymond Roestenburg

code: http://github.com/RayRoestenburg
blog: http://roestenburg.agilesquad.com
twtr: @RayRoestenburg
book: http://manning.com/roestenburg

-- 
  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] Unpersist a processor

2014-03-23 Thread Heiko Seeberger
Hi,

Is it possible to remove a processor from the journal, so its id can be 
reused as a fresh processor later?

Thanks
Heiko

-- 
  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] Unpersist a processor

2014-03-23 Thread Konrad Malawski
Hello Heiko,

This can be achieved but at expense of having to delete all messages stored in 
the journal for a given processor id.

This can be done from within the Processor by calling 
deleteMessages(toSequenceNr = Long.MaxValue, permanent: Boolean = …), where 
permanent deletion is optional - soft deleted messages won't be replayed 
anyway, so it will seam as-if it's a fresh Processor.

Hope this helps to answer the general question :-) If it's more of a 
real-world-app question, let's maybe check out an example scenario, because in 
general it feels a bit weird to re-use these ids (at least to me), as it might 
complicate reasoning about the system's state at some point in time…


-- 
Konrad Malawski
geecon.org / java.pl / krakowscala.pl / gdgkrakow.pl

From: Heiko Seeberger heiko.seeber...@gmail.com
Reply: akka-user@googlegroups.com akka-user@googlegroups.com
Date: 23 March 2014 at 12:21:38
To: akka-user@googlegroups.com akka-user@googlegroups.com
Subject:  [akka-user] Unpersist a processor  

Hi,

Is it possible to remove a processor from the journal, so its id can be reused 
as a fresh processor later?

Thanks
Heiko
--
 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] testing akka cluster on Blue Waters @ NCSA

2014-03-23 Thread Boris Capitanu
Hi Patrik,

After further testing, I'm running into an issue I can't explain and I'm 
hoping you could shed some light on it...
The simplest form that showcases the problem is the following setup:

Two actors... a Sender and a Receiver, using RemoteActorRefProvider.  The 
receiver is started on a known port and waits to receive case class 
Message(id: Int) messages.
When the sender starts (as a different JVM process), it looks up the 
ActorRef of the receiver, and then does: for i=1 to N { receiver ! 
Message(i) }
(the code for this is here: 
https://github.com/borice/akka-remote-actor-flood-test)

What I'm seeing is that if I look at the amount of time it takes to receive 
20K messages, that time depends on the value of N (which it shouldn't). 
For example, when N=100,000,  it takes about 500ms - 600ms to receive 20K 
messages.   When N=800,00, it takes 6-7 seconds (10x increase) per 20K 
messages 
The other weird thing is that the later batches of 20K messages are 
received progressively faster.

If you look at the GitHub link above, the README.md file contains example 
log output after running the application for different values of N. 
I've ran both sender and receiver through a profiler (YourKit profiler) and 
here's what I'm seeing:

For N = 100,000

https://lh5.googleusercontent.com/-StPZXZuvXf4/Uy9hGzSyIbI/J-c/NIpqSdavFTs/s3200/profile_100k.png

For N = 800,000 (stopped capturing profiler data after receiver received 
300,000 messages)

https://lh5.googleusercontent.com/-u2dHrkV3YkM/Uy9d1zeaDKI/J-Q/16tlNRzagOk/s3200/profile_800k.png
From the socket send/receive graphs it looks like the sender isn't sending 
the data out as fast as the network can handle... (in other words, I'm 
inclined to think that something in the sending side is not taking 
advantage of all the network bandwidth available.  The CPU usage was not 
being maxed out either... the garbage collector wasn't working overly 
hard... so I'm not sure I understand why using a different value for N (the 
number of messages sent) matters to the amount of time each block of 
messages is received.

Does this make sense to you?

One other usage for Akka I was planning is to retrieve streaming data from 
a Microsoft Kinect from a service sending it via UDP, then do some 
calculations on it, and send it back out to someone else via UDP.   So this 
would be a live continuous stream of data coming at (for now) 30 
readings/second... but soon perhaps at 100 readings/second.

Thanks very much for your help!!!

Best,
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+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-03-23 Thread √iktor Ҡlang
Hi Boris,

what serializer are you using for your messages?


On Sun, Mar 23, 2014 at 11:39 PM, Boris Capitanu bor...@gmail.com wrote:

 Hi Patrik,

 After further testing, I'm running into an issue I can't explain and I'm
 hoping you could shed some light on it...
 The simplest form that showcases the problem is the following setup:

 Two actors... a Sender and a Receiver, using RemoteActorRefProvider.  The
 receiver is started on a known port and waits to receive case class
 Message(id: Int) messages.
 When the sender starts (as a different JVM process), it looks up the
 ActorRef of the receiver, and then does: for i=1 to N { receiver !
 Message(i) }
 (the code for this is here:
 https://github.com/borice/akka-remote-actor-flood-test)

 What I'm seeing is that if I look at the amount of time it takes to
 receive 20K messages, that time depends on the value of N (which it
 shouldn't).
 For example, when N=100,000,  it takes about 500ms - 600ms to receive 20K
 messages.   When N=800,00, it takes 6-7 seconds (10x increase) per 20K
 messages 
 The other weird thing is that the later batches of 20K messages are
 received progressively faster.

 If you look at the GitHub link above, the README.md file contains example
 log output after running the application for different values of N.
 I've ran both sender and receiver through a profiler (YourKit profiler)
 and here's what I'm seeing:

 For N = 100,000


 https://lh5.googleusercontent.com/-StPZXZuvXf4/Uy9hGzSyIbI/J-c/NIpqSdavFTs/s3200/profile_100k.png

 For N = 800,000 (stopped capturing profiler data after receiver received
 300,000 messages)


 https://lh5.googleusercontent.com/-u2dHrkV3YkM/Uy9d1zeaDKI/J-Q/16tlNRzagOk/s3200/profile_800k.png
 From the socket send/receive graphs it looks like the sender isn't sending
 the data out as fast as the network can handle... (in other words, I'm
 inclined to think that something in the sending side is not taking
 advantage of all the network bandwidth available.  The CPU usage was not
 being maxed out either... the garbage collector wasn't working overly
 hard... so I'm not sure I understand why using a different value for N (the
 number of messages sent) matters to the amount of time each block of
 messages is received.

 Does this make sense to you?

 One other usage for Akka I was planning is to retrieve streaming data from
 a Microsoft Kinect from a service sending it via UDP, then do some
 calculations on it, and send it back out to someone else via UDP.   So this
 would be a live continuous stream of data coming at (for now) 30
 readings/second... but soon perhaps at 100 readings/second.

 Thanks very much for your help!!!

 Best,
 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+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.




-- 
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+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-03-23 Thread Boris Capitanu
Hello Viktor,

I am using whatever default serializer Akka comes with.  I have not 
configured anything special for that.

-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+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-03-23 Thread √iktor Ҡlang
Hello Boris,

Then you are likely to benchmark the slowness of Java Serialization.

To maximize performance, one needs to choose an appropriate serializer.


On Mon, Mar 24, 2014 at 1:51 AM, Boris Capitanu bor...@gmail.com wrote:

 Hello Viktor,

 I am using whatever default serializer Akka comes with.  I have not
 configured anything special for that.

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




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