Re: [akka-user] DeadLetters with Router/ActorSelection with remote routees

2014-07-14 Thread Pierre Falda
Hi Martynas Mickevičius,

thank you, this fixed the connection problem with the hostname that I
reported in the other thread! :-)

Pierre
> Also I just noticed an error in your configuration. Instead:
>
> remote {
> enabled-transports = ["akka.remote.netty.tcp"]
> hostname = "Vortex"
> netty.tcp.port = 2553
> }
>
> it should be
>
> remote {
> enabled-transports = ["akka.remote.netty.tcp"]
> netty.tcp {
> hostname = "Vortex"
> port = 2553
> }
> }
>
>
> On Fri, Jul 11, 2014 at 6:07 PM, Martynas Mickevičius
>  > wrote:
>
> Hi Pierre,
>
> router itself is not an actor. It is an optimized ActorRef which
> sends messages directly to the routees. Therefore you can't select
> router with ActorSelection. However you can select individual
> children with ActorSelection which has names c1, c2, ...:
>
> ActorSelection router_selection =
> 
> test_system.actorSelection("akka.tcp://PingActorSystem@192.168.2.17:2553/LocalRouter
> /c1");
>
> But that is not very useful.
>
>
> On Fri, Jul 11, 2014 at 2:00 PM, Pierre Falda
> mailto:p.fa...@disbrain.com>> wrote:
>
> Hi everyone,
>
> I set up a little testing environment to debug another problem
> with remoting, but I'm stuck on an issue (?) with
> actorselection: telling a message to a remotely created router
> works, telling the message to an actorselectopn of that
> router, routes the message to deadletters.
> Akka version: 2.3.3
> (At the end of the mail, the application.conf)
>
> My test code:
>
> public class Main {
>
> public static void main(String[] args) throws
> InterruptedException {
>
> ActorSystem test_system =
> akka.actor.ActorSystem.create("PingActorSystem");
>
>
> 
> test_system.eventStream().subscribe(test_system.actorOf(Props.create(EventWatcher.class)),Object.class);
>
> ActorRef router =
> test_system.actorOf(Props.create(LocalRouter.class).withRouter(new
> FromConfig()),"LocalRouter");
>
> ActorSelection router_selection =
> 
> test_system.actorSelection("akka.tcp://PingActorSystem@192.168.2.17:2553/LocalRouter
> ");
>
> Thread.sleep(1000);
>
> System.err.println(String.format("Selection ActorPath:
> %s AnchorPath:
> %s",router_selection.pathString(),router_selection.anchorPath()));
>
> router.tell(new Integer(1234),ActorRef.noSender());
>
> router_selection.tell("PING!?!?",ActorRef.noSender());
>
> }
>
> }
>
> The Output:
>
> [INFO] [07/11/2014 12:35:43.352] [main] [Remoting] Starting
> remoting
> [INFO] [07/11/2014 12:35:43.507] [main] [Remoting] Remoting
> started; listening on addresses
> :[akka.tcp://PingActorSystem@192.168.2.17:2553
> ]
> [INFO] [07/11/2014 12:35:43.508] [main] [Remoting] Remoting
> now listens on addresses:
> [akka.tcp://PingActorSystem@192.168.2.17:2553
> ]
> Received: akka.remote.AssociatedEvent
> Selection ActorPath: /LocalRouter AnchorPath:
> akka://PingActorSystem/
> Received: akka.actor.DeadLetter
> java.lang.String
> Received: akka.event.Logging$Info
> [INFO] [07/11/2014 12:35:44.540]
> [PingActorSystem-akka.actor.default-dispatcher-4]
> [akka://PingActorSystem/LocalRouter] Message
> [java.lang.String] from
> Actor[akka://PingActorSystem/deadLetters] to
> Actor[akka://PingActorSystem/LocalRouter] 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'.
>
> The remote routees are successfully created and are not dead.
> I have no log at all on the worker/routees console
> (PongActorSystem), except for the receive of the numeric message.
>
> Then I tried to ActorSelect the router from a third machine,
> but I have the same behaviour: message are correctly sent to
> the remote router (PingActoSystem), but instead
> of forwarding it to the remotely deployed routees ( target {
>  nodes = ["akka.tcp://PongActorSystem@192.168.2.17:2552
> "] } ) it routes the
> message to deadletters.
>
> Does anyone have ever had a similar issue? How could I fix?
>
> Thanks in advance
>
> - Pierre
>
> Configuration:
>
> 

[akka-user] How to run akka stream distributedly in a cluster?

2014-07-14 Thread Sean Zhong
How to run akka stream distributedly in a cluster?

Suppose a Flow DSL will be translated to 100 actors. How to configure these 
actor in start in different machine of the cluster?



-- 
>>  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] How to run akka stream distributedly in a cluster?

2014-07-14 Thread Konrad 'ktoso' Malawski
That’s currently not supported.
Streams are a very fresh module, and we’re still working to get the in-jvm 
semantics and APIs *right* before we go distributed.


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


[akka-user] [akka-stream 0.3] Exception when shutdown actor-system

2014-07-14 Thread Wolfgang F.
Hi

I found a small bug in the implementation of the ActorProducer. 

I created an Actor (which has the ActorProducer implemented) 
I did not use the actor (I just created it)
When now the system is shutdown the following exception occurs

*Exception:*

java.lang.NullPointerException: null
at 
akka.stream.actor.ActorProducer$class.aroundPostStop(ActorProducer.scala:237) 
~[akka-stream-experimental_2.10-0.3.jar:na]
at 
com.jd.hddoc.dispatcher.com.api.ConsumerProducerActor.aroundPostStop(ConsumerProducerActor.scala:7)
 
~[classes/:na]
at 
akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:210)
 
~[akka-actor_2.10-2.3.3.jar:na]

It caused because the state isActive returns true but subscribes is 
uninitialized 

*Sample:*

class ProducerActor() extends  ActorProducer[Int] {...}

...
   val system = ActorSystem("serverSystem", serverConf)
   val sourceAndDestination = system.actorOf(Props[ProducerActor])
   system.shutdown()
...

Regards

Wolfgang

-- 
>>  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] How to run akka stream distributedly in a cluster?

2014-07-14 Thread Sean Zhong
Thanks,

I come from bigdata background.
In my opinion, the Flow DSL is not expressive for many cases, like data 
shuffle. Have you considered using DSL like the one used in cascading, or 
spark, or storm trident? 

How can I help in this process?

Sean

On Monday, July 14, 2014 4:26:58 PM UTC+8, Konrad Malawski wrote:
>
> That’s currently not supported.
> Streams are a very fresh module, and we’re still working to get the in-jvm 
> semantics and APIs *right* before we go distributed.
>
>
> -- 
> 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] How to run akka stream distributedly in a cluster?

2014-07-14 Thread Endre Varga
HI Sean,


> I come from bigdata background.
> In my opinion, the Flow DSL is not expressive for many cases, like data
> shuffle. Have you considered using DSL like the one used in cascading, or
> spark, or storm trident?
>

The primary goal for streams is to provide a unified way to handle
backpressure across asynchronous and probably remote boundaries. So the
primary goal is safe integration across multiple threads/hosts over
network/IO etc. The shuffle you need is a fairly special one I am not sure
it will be covered by akka-streams. Remember though that akka-streams is
just an implementation of the reactive-streams standard -- in the future
there will be probably adapters to Spark/Storm/etc. so you will be able to
plug your akka streams together with big-data oriented frameworks.

-Endre


>
> How can I help in this process?
>
> Sean
>
>
> On Monday, July 14, 2014 4:26:58 PM UTC+8, Konrad Malawski wrote:
>>
>> That’s currently not supported.
>> Streams are a very fresh module, and we’re still working to get the
>> in-jvm semantics and APIs *right* before we go distributed.
>>
>>
>> --
>> 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.
>

-- 
>>  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] How to run akka stream distributedly in a cluster?

2014-07-14 Thread Konrad 'ktoso' Malawski
As Endre already highlighted, we have a different focus than the 
specialised-for-big-data frameworks.

Our focus is to get the back-pressure semantics and common API among library 
implementors right (the reactive streams API).
There’s a lot of discussions around these still happening at 
https://github.com/reactive-streams/reactive-streams if you’re interested.
The spec is still evolving actively.

APIs will continue to be improved of course and we are well aware of 
Spark/Storm/Scalding (with the last one I’ve spent a lot of time ;-)).

If you think we’re missing any fundamental combinators please check if they’re 
already in our todo’s or open a ticket: 
https://github.com/akka/akka/issues?labels=t%3Astream&page=1&state=open

-- 
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] How to run akka stream distributedly in a cluster?

2014-07-14 Thread Sean Zhong
Thank you both for your reply.

I believe there lacks some combinators, I will comment later after I check 
the github todo list.

On Monday, July 14, 2014 4:55:59 PM UTC+8, Konrad Malawski wrote:
>
> As Endre already highlighted, we have a different focus than the 
> specialised-for-big-data frameworks.
>
> Our focus is to get the back-pressure semantics and common API among 
> library implementors right (the reactive streams API).
> There’s a lot of discussions around these still happening at 
> https://github.com/reactive-streams/reactive-streams if you’re interested.
> The spec is still evolving actively.
>
> APIs will continue to be improved of course and we are well aware of 
> Spark/Storm/Scalding (with the last one I’ve spent a lot of time ;-)).
>
> If you think we’re missing any fundamental combinators please check if 
> they’re already in our todo’s or open a ticket: 
> https://github.com/akka/akka/issues?labels=t%3Astream&page=1&state=open
>
> 
> -- 
> 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] [akka-stream 0.3] Exception when shutdown actor-system

2014-07-14 Thread Konrad Malawski
Thanks for reporting, Wolfgang!
Looks like a bug indeed, would you mind creating an issue with these
details on our issue tracker?

https://github.com/akka/akka/issues?labels=t%3Astream&state=open


On Mon, Jul 14, 2014 at 10:37 AM, Wolfgang F. 
wrote:

> Hi
>
> I found a small bug in the implementation of the ActorProducer.
>
> I created an Actor (which has the ActorProducer implemented)
> I did not use the actor (I just created it)
> When now the system is shutdown the following exception occurs
>
> *Exception:*
>
> java.lang.NullPointerException: null
> at
> akka.stream.actor.ActorProducer$class.aroundPostStop(ActorProducer.scala:237)
> ~[akka-stream-experimental_2.10-0.3.jar:na]
> at
> com.jd.hddoc.dispatcher.com.api.ConsumerProducerActor.aroundPostStop(ConsumerProducerActor.scala:7)
> ~[classes/:na]
> at
> akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:210)
> ~[akka-actor_2.10-2.3.3.jar:na]
>
> It caused because the state isActive returns true but subscribes is
> uninitialized
>
> *Sample:*
>
> class ProducerActor() extends  ActorProducer[Int] {...}
>
> ...
>val system = ActorSystem("serverSystem", serverConf)
>val sourceAndDestination = system.actorOf(Props[ProducerActor])
>system.shutdown()
> ...
>
> Regards
>
> Wolfgang
>
> --
> >> 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,
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.


[akka-user] Re: Questions about akka persistence and scalability

2014-07-14 Thread Alexandre Delegue
Thanks, I've watched the talk and it was pretty good. 
What append when a new persistent actor start on a shard. Does it receive 
all the message from the journal on the receiceRecover method or just a 
subset filtered by the shardResolver ? 

Thanks, 
Alex


Le samedi 12 juillet 2014 19:04:13 UTC+2, Alexandre Delegue a écrit :
>
> Hi, 
>
> I have some questions about akka persistence and scalabity and how to 
> implement certain use case. 
>
> The idea is to have an application that I can clone depending on the load. 
> With akka persistence (event sourcing), if I clone an app I will have N 
> persistents actor with the same persistent id : 
> - If the journal is distributed each instance of persistent actor will 
> write on the same journal. No problem if the order of the events stays the 
> same. 
> - If the state is persisted on DB, each node will share the same state. 
> There is a problem when the persistent actor of each node start and replays 
> the events from the journal, the state will be updated from different 
> source and will be wrong. I can't persist the state on memory if I have to 
> much element to deal with. 
>
> What is the best way to deal with this problem ? 
>
> For exemple if I have a shopping cart and the events are the actions the 
> users can perform (create cart, add item, order ...) how can I scale that 
> with akka persistence and event sourcing ? 
>
> Thanks, 
> Alex
>
>

-- 
>>  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-persistence] Event sourcing and large modifiable entities

2014-07-14 Thread Javier Santos Paniego
Hi,

I have a modifiable entity with lots of attributes that might be 
values(like dates) or entity references :

case class Entity(attribute1: String, attribute2: Int, ..., attribute22: 
Boolean)

My question is: If I follow DDD and Event sourcing philosophy, should I 
have an action and an event for each modifiable attribute? 
Maybe I could avoid writing some boilerplate if I used macros (action 
'UpdateAttribute(attributename, value)' and event 
'AttributeUpdated(attributename,value)') but, is this a sane practise?
Is there any other simplier way to do that?

Thanks for any advise,

Javier

-- 
>>  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-persistence vs durable mailbox

2014-07-14 Thread Konrad Malawski
Hello Jeff,

Basically I want to pile a bunch of messages into this mailbox and have the
> actor process them when it "can" with a producer timeout restriction. I
> know this is related to the Reactive Stream stuff, but I'm interested in
> something near term and deciding if I should implement a DurableMailbox or
> spend more time trying to bend Persistence to work with my stateless
> actor.
>
When reading your description I was about to answer “reactive streams”, but
I see you’re well aware already :-)

Have you seen this thread: [akka-user] Pulling pattern vs. Durable Mailboxes
?

One thing you could do is to introduce an intermediate actor, which will
handle the persisting, and your worker actor would pull the work from this
PersistentActor.
The persistentActor can then deleteMessages(toSequenceNr: Long) once it
gets a confirmation that the worker processed messages until N.
​
-- 
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.


[akka-user] How to create typed actor router?

2014-07-14 Thread simafengyun
Hi All,


I want to use the typed actor's router. But I only see the untyped actor 
router code.

Do you  have the java code for creating typed actor router? 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.


Re: [akka-user] [akka-stream 0.3] Exception when shutdown actor-system

2014-07-14 Thread Wolfgang F.
I added the issue https://github.com/akka/akka/issues/15535


Am Montag, 14. Juli 2014 11:24:28 UTC+2 schrieb Konrad Malawski:
>
> Thanks for reporting, Wolfgang!
> Looks like a bug indeed, would you mind creating an issue with these 
> details on our issue tracker?
>
> https://github.com/akka/akka/issues?labels=t%3Astream&state=open
>
>
> On Mon, Jul 14, 2014 at 10:37 AM, Wolfgang F.  > wrote:
>
>> Hi
>>
>> I found a small bug in the implementation of the ActorProducer. 
>>
>> I created an Actor (which has the ActorProducer implemented) 
>> I did not use the actor (I just created it)
>> When now the system is shutdown the following exception occurs
>>
>> *Exception:*
>>
>> java.lang.NullPointerException: null
>> at 
>> akka.stream.actor.ActorProducer$class.aroundPostStop(ActorProducer.scala:237)
>>  
>> ~[akka-stream-experimental_2.10-0.3.jar:na]
>> at 
>> com.jd.hddoc.dispatcher.com.api.ConsumerProducerActor.aroundPostStop(ConsumerProducerActor.scala:7)
>>  
>> ~[classes/:na]
>> at 
>> akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:210)
>>  
>> ~[akka-actor_2.10-2.3.3.jar:na]
>>
>> It caused because the state isActive returns true but subscribes is 
>> uninitialized 
>>
>> *Sample:*
>>
>> class ProducerActor() extends  ActorProducer[Int] {...}
>>
>> ...
>>val system = ActorSystem("serverSystem", serverConf)
>>val sourceAndDestination = system.actorOf(Props[ProducerActor])
>>system.shutdown()
>> ...
>>
>> Regards
>>
>> Wolfgang
>>
>> -- 
>> >> 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,
> 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] [akka-stream 0.3] Exception when shutdown actor-system

2014-07-14 Thread Konrad 'ktoso' Malawski
Thanks for reporting Wolfgang!
We’ll look into this.

On 14 July 2014 at 12:47:42, Wolfgang F. (wolfgang.fri...@hotmail.com) wrote:

I added the issue https://github.com/akka/akka/issues/15535


Am Montag, 14. Juli 2014 11:24:28 UTC+2 schrieb Konrad Malawski:
Thanks for reporting, Wolfgang!
Looks like a bug indeed, would you mind creating an issue with these details on 
our issue tracker?

https://github.com/akka/akka/issues?labels=t%3Astream&state=open


On Mon, Jul 14, 2014 at 10:37 AM, Wolfgang F.  wrote:
Hi

I found a small bug in the implementation of the ActorProducer.

I created an Actor (which has the ActorProducer implemented)
I did not use the actor (I just created it)
When now the system is shutdown the following exception occurs

Exception:

java.lang.NullPointerException: null
    at 
akka.stream.actor.ActorProducer$class.aroundPostStop(ActorProducer.scala:237) 
~[akka-stream-experimental_2.10-0.3.jar:na]
    at 
com.jd.hddoc.dispatcher.com.api.ConsumerProducerActor.aroundPostStop(ConsumerProducerActor.scala:7)
 ~[classes/:na]
    at 
akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:210)
 ~[akka-actor_2.10-2.3.3.jar:na]

It caused because the state isActive returns true but subscribes is 
uninitialized

Sample:

class ProducerActor() extends  ActorProducer[Int] {...}

    ...
   val system = ActorSystem("serverSystem", serverConf)
   val sourceAndDestination = system.actorOf(Props[ProducerActor])
   system.shutdown()
    ...

Regards

Wolfgang
--
>> 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,
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.
-- 
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] How to create typed actor router?

2014-07-14 Thread Konrad Malawski
Hello there,
Since TypedActors are implemented as plain message sends (the message
representing the proxy method calls is called MethodCall), you can simply
do an untyped router, and then add a typed proxy before it:

"TypedActor Router" must {

  "work" in {
val t1 = newFooBar
val t2 = newFooBar
val t3 = newFooBar
val t4 = newFooBar
val routees = List(t1, t2, t3, t4) map { t ⇒
TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }

val router = system.actorOf(RoundRobinGroup(routees).props(), "router")

val typedRouter = TypedActor(system).typedActorOf[Foo,
Foo](TypedProps[Foo](), router)

info("got = " + typedRouter.optionPigdog())
info("got = " + typedRouter.optionPigdog())
info("got = " + typedRouter.optionPigdog())
info("got = " + typedRouter.optionPigdog())
info("got = " + typedRouter.optionPigdog())

mustStop(t1)
mustStop(t2)
mustStop(t3)
mustStop(t4)
  }
}


And with a small modification of the pigdog to include a number (instance
value), we can see that the routing actually works:

[info] TypedActorRouterSpec:
[info] TypedActor Router
[info] - must work (134 milliseconds)
[info]   + got = Some(Pigdog-33)
[info]   + got = Some(Pigdog-46)
[info]   + got = Some(Pigdog-25)
[info]   + got = Some(Pigdog-19)
[info]   + got = Some(Pigdog-33)


// whoa, intellij's new colorized copy paste is a bit weird. Not sure if
awesome or just weird ;-)
-- 
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] How to create typed actor router?

2014-07-14 Thread √iktor Ҡlang
<3 pigdog


On Mon, Jul 14, 2014 at 1:24 PM, Konrad Malawski <
konrad.malaw...@typesafe.com> wrote:

> Hello there,
> Since TypedActors are implemented as plain message sends (the message
> representing the proxy method calls is called MethodCall), you can simply
> do an untyped router, and then add a typed proxy before it:
>
> "TypedActor Router" must {
>
>   "work" in {
> val t1 = newFooBar
> val t2 = newFooBar
> val t3 = newFooBar
> val t4 = newFooBar
> val routees = List(t1, t2, t3, t4) map { t ⇒ 
> TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }
>
> val router = system.actorOf(RoundRobinGroup(routees).props(), "router")
>
> val typedRouter = TypedActor(system).typedActorOf[Foo, 
> Foo](TypedProps[Foo](), router)
>
> info("got = " + typedRouter.optionPigdog())
> info("got = " + typedRouter.optionPigdog())
> info("got = " + typedRouter.optionPigdog())
> info("got = " + typedRouter.optionPigdog())
> info("got = " + typedRouter.optionPigdog())
>
> mustStop(t1)
> mustStop(t2)
> mustStop(t3)
> mustStop(t4)
>   }
> }
>
>
> And with a small modification of the pigdog to include a number (instance
> value), we can see that the routing actually works:
>
> [info] TypedActorRouterSpec:
> [info] TypedActor Router
> [info] - must work (134 milliseconds)
> [info]   + got = Some(Pigdog-33)
> [info]   + got = Some(Pigdog-46)
> [info]   + got = Some(Pigdog-25)
> [info]   + got = Some(Pigdog-19)
> [info]   + got = Some(Pigdog-33)
>
>
> // whoa, intellij's new colorized copy paste is a bit weird. Not sure if
> awesome or just weird ;-)
> --
> 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.
>



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


Re: [akka-user] How to create typed actor router?

2014-07-14 Thread Konrad Malawski
You know it's Victor's code if there's pigdogs inside :-)

PS: I'm not sure if this a pattern popular enough to embrace and add it to
the docs... Opinions?


On Mon, Jul 14, 2014 at 1:26 PM, √iktor Ҡlang 
wrote:

> <3 pigdog
>
>
> On Mon, Jul 14, 2014 at 1:24 PM, Konrad Malawski <
> konrad.malaw...@typesafe.com> wrote:
>
>> Hello there,
>> Since TypedActors are implemented as plain message sends (the message
>> representing the proxy method calls is called MethodCall), you can
>> simply do an untyped router, and then add a typed proxy before it:
>>
>> "TypedActor Router" must {
>>
>>   "work" in {
>> val t1 = newFooBar
>> val t2 = newFooBar
>> val t3 = newFooBar
>> val t4 = newFooBar
>> val routees = List(t1, t2, t3, t4) map { t ⇒ 
>> TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }
>>
>> val router = system.actorOf(RoundRobinGroup(routees).props(), "router")
>>
>> val typedRouter = TypedActor(system).typedActorOf[Foo, 
>> Foo](TypedProps[Foo](), router)
>>
>> info("got = " + typedRouter.optionPigdog())
>> info("got = " + typedRouter.optionPigdog())
>> info("got = " + typedRouter.optionPigdog())
>> info("got = " + typedRouter.optionPigdog())
>> info("got = " + typedRouter.optionPigdog())
>>
>> mustStop(t1)
>> mustStop(t2)
>> mustStop(t3)
>> mustStop(t4)
>>   }
>> }
>>
>>
>> And with a small modification of the pigdog to include a number (instance
>> value), we can see that the routing actually works:
>>
>> [info] TypedActorRouterSpec:
>> [info] TypedActor Router
>> [info] - must work (134 milliseconds)
>> [info]   + got = Some(Pigdog-33)
>> [info]   + got = Some(Pigdog-46)
>> [info]   + got = Some(Pigdog-25)
>> [info]   + got = Some(Pigdog-19)
>> [info]   + got = Some(Pigdog-33)
>>
>>
>> // whoa, intellij's new colorized copy paste is a bit weird. Not sure if
>> awesome or just weird ;-)
>> --
>> 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.
>>
>
>
>
> --
> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
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] How to create typed actor router?

2014-07-14 Thread Konrad Malawski
Viktor's* - I keep mistyping your name recently, don't know why. Sorry,
Viktor. ;-)


On Mon, Jul 14, 2014 at 1:26 PM, Konrad Malawski  wrote:

> You know it's Victor's code if there's pigdogs inside :-)
>
> PS: I'm not sure if this a pattern popular enough to embrace and add it to
> the docs... Opinions?
>
>
> On Mon, Jul 14, 2014 at 1:26 PM, √iktor Ҡlang 
> wrote:
>
>> <3 pigdog
>>
>>
>> On Mon, Jul 14, 2014 at 1:24 PM, Konrad Malawski <
>> konrad.malaw...@typesafe.com> wrote:
>>
>>> Hello there,
>>> Since TypedActors are implemented as plain message sends (the message
>>> representing the proxy method calls is called MethodCall), you can
>>> simply do an untyped router, and then add a typed proxy before it:
>>>
>>> "TypedActor Router" must {
>>>
>>>   "work" in {
>>> val t1 = newFooBar
>>> val t2 = newFooBar
>>> val t3 = newFooBar
>>> val t4 = newFooBar
>>> val routees = List(t1, t2, t3, t4) map { t ⇒ 
>>> TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }
>>>
>>> val router = system.actorOf(RoundRobinGroup(routees).props(), "router")
>>>
>>> val typedRouter = TypedActor(system).typedActorOf[Foo, 
>>> Foo](TypedProps[Foo](), router)
>>>
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>>
>>> mustStop(t1)
>>> mustStop(t2)
>>> mustStop(t3)
>>> mustStop(t4)
>>>   }
>>> }
>>>
>>>
>>> And with a small modification of the pigdog to include a number
>>> (instance value), we can see that the routing actually works:
>>>
>>> [info] TypedActorRouterSpec:
>>> [info] TypedActor Router
>>> [info] - must work (134 milliseconds)
>>> [info]   + got = Some(Pigdog-33)
>>> [info]   + got = Some(Pigdog-46)
>>> [info]   + got = Some(Pigdog-25)
>>> [info]   + got = Some(Pigdog-19)
>>> [info]   + got = Some(Pigdog-33)
>>>
>>>
>>> // whoa, intellij's new colorized copy paste is a bit weird. Not sure if
>>> awesome or just weird ;-)
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> 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 http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Cheers,
> Konrad 'ktoso' Malawski
> hAkker @ Typesafe
>
> 
>



-- 
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] How to create typed actor router?

2014-07-14 Thread √iktor Ҡlang
It's alright Kônräd :)


On Mon, Jul 14, 2014 at 1:29 PM, Konrad Malawski  wrote:

> Viktor's* - I keep mistyping your name recently, don't know why. Sorry,
> Viktor. ;-)
>
>
> On Mon, Jul 14, 2014 at 1:26 PM, Konrad Malawski 
> wrote:
>
>> You know it's Victor's code if there's pigdogs inside :-)
>>
>> PS: I'm not sure if this a pattern popular enough to embrace and add it
>> to the docs... Opinions?
>>
>>
>> On Mon, Jul 14, 2014 at 1:26 PM, √iktor Ҡlang 
>> wrote:
>>
>>> <3 pigdog
>>>
>>>
>>> On Mon, Jul 14, 2014 at 1:24 PM, Konrad Malawski <
>>> konrad.malaw...@typesafe.com> wrote:
>>>
 Hello there,
 Since TypedActors are implemented as plain message sends (the message
 representing the proxy method calls is called MethodCall), you can
 simply do an untyped router, and then add a typed proxy before it:

 "TypedActor Router" must {

   "work" in {
 val t1 = newFooBar
 val t2 = newFooBar
 val t3 = newFooBar
 val t4 = newFooBar
 val routees = List(t1, t2, t3, t4) map { t ⇒ 
 TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }

 val router = system.actorOf(RoundRobinGroup(routees).props(), "router")

 val typedRouter = TypedActor(system).typedActorOf[Foo, 
 Foo](TypedProps[Foo](), router)

 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())

 mustStop(t1)
 mustStop(t2)
 mustStop(t3)
 mustStop(t4)
   }
 }


 And with a small modification of the pigdog to include a number
 (instance value), we can see that the routing actually works:

 [info] TypedActorRouterSpec:
 [info] TypedActor Router
 [info] - must work (134 milliseconds)
 [info]   + got = Some(Pigdog-33)
 [info]   + got = Some(Pigdog-46)
 [info]   + got = Some(Pigdog-25)
 [info]   + got = Some(Pigdog-19)
 [info]   + got = Some(Pigdog-33)


 // whoa, intellij's new colorized copy paste is a bit weird. Not sure
 if awesome or just weird ;-)
 --
 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.

>>>
>>>
>>>
>>> --
>>> 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 http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Cheers,
>> Konrad 'ktoso' Malawski
>> hAkker @ Typesafe
>>
>> 
>>
>
>
>
> --
> 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.
>



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

Re: [akka-user] [Akka-persistence] Event sourcing and large modifiable entities

2014-07-14 Thread Konrad Malawski
Hello Javier,
It's a bit hard to answer on event design questions when we discuss
"Entity" and "Event" :-)
But in general these events should have some meaning, not only
"AttributeUpdated" - as in "BughtItem", "ShippedThingy", "ConfirmedPayment".

Play around with the granularity of your events, maybe you're being too
fine grained?
These are good books about DDD in general, so if you haven't already you
might want to check them out:

* "THE Book":
http://www.amazon.co.uk/Domain-driven-Design-Tackling-Complexity-Software/dp/0321125215/ref=sr_1_2?ie=UTF8&qid=1405338610&sr=8-2&keywords=ddd
*
http://www.amazon.co.uk/Implementing-Domain-Driven-Design-Vaughn-Vernon/dp/0321834577/ref=sr_1_1?ie=UTF8&qid=1405338610&sr=8-1&keywords=ddd

:-)


On Mon, Jul 14, 2014 at 11:56 AM, Javier Santos Paniego  wrote:

> Hi,
>
> I have a modifiable entity with lots of attributes that might be
> values(like dates) or entity references :
>
> case class Entity(attribute1: String, attribute2: Int, ..., attribute22:
> Boolean)
>
> My question is: If I follow DDD and Event sourcing philosophy, should I
> have an action and an event for each modifiable attribute?
> Maybe I could avoid writing some boilerplate if I used macros (action
> 'UpdateAttribute(attributename, value)' and event
> 'AttributeUpdated(attributename,value)') but, is this a sane practise?
> Is there any other simplier way to do that?
>
> Thanks for any advise,
>
> Javier
>
> --
> >> 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,
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] How to create typed actor router?

2014-07-14 Thread Jonas Bonér
On Mon, Jul 14, 2014 at 1:26 PM, Konrad Malawski  wrote:

> You know it's Victor's code if there's pigdogs inside :-)
>
> PS: I'm not sure if this a pattern popular enough to embrace and add it to
> the docs... Opinions?
>
>
I think it is useful enough.
​

>
> On Mon, Jul 14, 2014 at 1:26 PM, √iktor Ҡlang 
> wrote:
>
>> <3 pigdog
>>
>>
>> On Mon, Jul 14, 2014 at 1:24 PM, Konrad Malawski <
>> konrad.malaw...@typesafe.com> wrote:
>>
>>> Hello there,
>>> Since TypedActors are implemented as plain message sends (the message
>>> representing the proxy method calls is called MethodCall), you can
>>> simply do an untyped router, and then add a typed proxy before it:
>>>
>>> "TypedActor Router" must {
>>>
>>>   "work" in {
>>> val t1 = newFooBar
>>> val t2 = newFooBar
>>> val t3 = newFooBar
>>> val t4 = newFooBar
>>> val routees = List(t1, t2, t3, t4) map { t ⇒ 
>>> TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }
>>>
>>> val router = system.actorOf(RoundRobinGroup(routees).props(), "router")
>>>
>>> val typedRouter = TypedActor(system).typedActorOf[Foo, 
>>> Foo](TypedProps[Foo](), router)
>>>
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>> info("got = " + typedRouter.optionPigdog())
>>>
>>> mustStop(t1)
>>> mustStop(t2)
>>> mustStop(t3)
>>> mustStop(t4)
>>>   }
>>> }
>>>
>>>
>>> And with a small modification of the pigdog to include a number
>>> (instance value), we can see that the routing actually works:
>>>
>>> [info] TypedActorRouterSpec:
>>> [info] TypedActor Router
>>> [info] - must work (134 milliseconds)
>>> [info]   + got = Some(Pigdog-33)
>>> [info]   + got = Some(Pigdog-46)
>>> [info]   + got = Some(Pigdog-25)
>>> [info]   + got = Some(Pigdog-19)
>>> [info]   + got = Some(Pigdog-33)
>>>
>>>
>>> // whoa, intellij's new colorized copy paste is a bit weird. Not sure if
>>> awesome or just weird ;-)
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> 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 http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> 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.
>



-- 

*Jonas Bonér*Phone: +46 733 777 123
Home: jonasboner.com
Twitter: @jboner 

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

Re: [akka-user] [Akka-persistence] Event sourcing and large modifiable entities

2014-07-14 Thread Javier Santos Paniego
Definitely we're not choosing the perfect granularity. 
I'll try to focus in meaningfull methods instead of isolated attribute 
changes.

Thanks for your time, Konrad :-)

El lunes, 14 de julio de 2014 13:51:35 UTC+2, Konrad Malawski escribió:
>
> Hello Javier,
> It's a bit hard to answer on event design questions when we discuss 
> "Entity" and "Event" :-)
> But in general these events should have some meaning, not only 
> "AttributeUpdated" - as in "BughtItem", "ShippedThingy", "ConfirmedPayment".
>
> Play around with the granularity of your events, maybe you're being too 
> fine grained?
> These are good books about DDD in general, so if you haven't already you 
> might want to check them out:
>
> * "THE Book": 
> http://www.amazon.co.uk/Domain-driven-Design-Tackling-Complexity-Software/dp/0321125215/ref=sr_1_2?ie=UTF8&qid=1405338610&sr=8-2&keywords=ddd
> * 
> http://www.amazon.co.uk/Implementing-Domain-Driven-Design-Vaughn-Vernon/dp/0321834577/ref=sr_1_1?ie=UTF8&qid=1405338610&sr=8-1&keywords=ddd
>
> :-)
>
>
> On Mon, Jul 14, 2014 at 11:56 AM, Javier Santos Paniego <
> jsa...@tecsisa.com > wrote:
>
>> Hi,
>>
>> I have a modifiable entity with lots of attributes that might be 
>> values(like dates) or entity references :
>>
>> case class Entity(attribute1: String, attribute2: Int, ..., attribute22: 
>> Boolean)
>>
>> My question is: If I follow DDD and Event sourcing philosophy, should I 
>> have an action and an event for each modifiable attribute? 
>> Maybe I could avoid writing some boilerplate if I used macros (action 
>> 'UpdateAttribute(attributename, value)' and event 
>> 'AttributeUpdated(attributename,value)') but, is this a sane practise?
>> Is there any other simplier way to do that?
>>
>> Thanks for any advise,
>>
>> Javier
>>
>> -- 
>> >> 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,
> 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] akka-persistence Processor emulation

2014-07-14 Thread Konrad Malawski
Hello Pavel,

It seems to me that you’re overdoing a lot inside that implementation.
I don’t really see what gain your own deliveryIds is meant to provide.

Let’s take a step back and look at the semantics of deliver and
confirmDelivery *during playback*.
During normal operation I think it’s clear how they work. However, when
recovery is running, and you call deliver(msg) it delays the sending until
recovery is complete:
​

def deliver(destination: ActorPath, deliveryIdToMessage: Long ⇒ Any): Unit = {
  // -- cut cut cut --
  if (recoveryRunning)
unconfirmed = unconfirmed.updated(deliveryId, d)
  elsesend(deliveryId, d, now)
}

So during replay you encounter confirmation events, and trigger
confirmDelivery, which removes the delivery from unconfirmed.
This means that unconfirmed will not be sent again - it was already
confirmed.
All other outstanding messages will be redelivered again - as expected.

And now as for pruning the actor’s event log:
All you need to track is one number - the (persistent) seqNr of the last
confirmed delivery (there are caveats to this, read on) - you can get it
via lastSequenceNr.

Please note that if you send messages to multiple destinations, one
destination could reply with 5 while the other didn’t reply to 4 yet.
So when updating this “safe to delete until” number, you must check that
it’s gap-less, or you’d delete a persistent message resulting in an emit of
an yet unconfirmed message send.
But if these are gap-less, you can issue an deleteMessages(toSequenceNr =
safeToDeleteUntilHereInclusive).

Again, I don’t think you need to track delivery ids like you are in your
example - that is exacly what AtLeastOnceDelivery does.
And your replay code can be simplified - to simply call deliver /
confirmDelivery during replay, and this will not result in not needed
message sends.

I hope this helps, if not let me know and we’ll investigate in more detail
:-)
​



-- 
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] akka-persistence Processor emulation

2014-07-14 Thread Konrad Malawski
This thread motivated me to improve the documentation on these methods a 
bit, progress can be tracked in this 
issue: https://github.com/akka/akka/issues/15538

-- k 

-- 
>>  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] javafx akka dispatcher leaks

2014-07-14 Thread Oleksandr Ryabuha
0down vote*favorite* 


I have created an executor:

public class GUIExecutorService extends AbstractExecutorService {
@Overridepublic void shutdown() {
}
@Overridepublic List shutdownNow() {
return new ArrayList<>();}
@Overridepublic boolean isShutdown() {
return false;}
@Overridepublic boolean isTerminated() {
return false;}
@Overridepublic boolean awaitTermination(long timeout, TimeUnit unit) throws 
InterruptedException {
return true;}
@Overridepublic void execute(Runnable command) {
Platform.runLater(command);}}

and configurator:

public class JavaFXEventThreadExecutorServiceConfigurator extends 
ExecutorServiceConfigurator {
public JavaFXEventThreadExecutorServiceConfigurator(Config config, 
DispatcherPrerequisites prerequisites) {
super(config, prerequisites);}
@Overridepublic ExecutorServiceFactory createExecutorServiceFactory(String id, 
ThreadFactory threadFactory) {
return () -> new GUIExecutorService(); }}

and I did use it :

this.navigatorActor = getContext().actorOf(new Props(() -> new 
NavigatorActor(stage)).withDispatcher("javafx-dispatcher"), "navigator" );

But once I want to stop in the application using:

actorSystem.shutdown();

My program still executes. 

Using last shutdown I hoped it should close all actor system.

Actor did not terminate.

What wrong with my code ?

-- 
>>  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] Kafka journal

2014-07-14 Thread Martin Krasser
There's now a first release of the Kafka journal. Details at 
https://github.com/krasserm/akka-persistence-kafka

Am Sonntag, 13. Juli 2014 16:19:55 UTC+2 schrieb Martin Krasser:
>
>  
> On 13.07.14 16:03, Richard Rodseth wrote:
>  
> Thanks for the detailed reply. I might have been forgetting that Akka 
> persistence can be used for more than persisting DDD aggregates. I had also 
> forgotten that the event store and snapshot store can be different.
>
>
> You can even use Kafka to implement a snapshot store. You just need to 
> enable log compaction 
>  which will always 
> keep the last snapshot (entry) for each persistent actor (key). I also plan 
> to implement a snapshot store backed by Kafka but I'm not sure at the 
> moment how well Kafka supports large log entries.
>
>  
>
> On Sun, Jul 13, 2014 at 12:51 AM, Martin Krasser  > wrote:
>
>>  Hi Richard,
>>
>> when using the Kafka journal with default/typical retention times, your 
>> application is responsible for storing snapshots at intervals that are 
>> significantly smaller than the retention time (for example, with a 
>> retention time of 7 days, you may want to take snapshots of your persistent 
>> actors every 3 days or so). Alternatively, configure Kafka to keep messages 
>> "forever" (i.e. set the retention time to the maximum value) if needed. I 
>> don't go into Kafka partitioning details here but it is possible to 
>> implement the journal driver in a way that both a single persistent actor's 
>> data are partitioned *and* kept in order. However, with the initial 
>> implementation, all data for a single persistent actor must fit on a single 
>> Kafka node (different persistent actors are of course distributed over a 
>> Kafka cluster). Hence, deleting old data after a few weeks and taking 
>> snapshots at regular interval is the way to go (which is good enough for 
>> many applications I think).
>>
>> The real value of the Kafka journal IMO comes with the many external 
>> integrations it supports. For example, you can can use the it as an input 
>> source for Spark streaming 
>>  
>> and can do (scalable) stream processing of events generated by persistent 
>> actors i.e. you can easily create Akka -> Kafka -> Spark Streaming 
>> pipelines. This is an alternative to Akka's PersistentView and even allows 
>> processing of events generated by several/all persistent actors with a 
>> single consumer such as a single Spark DStream (which is currently a 
>> limitation  when using 
>> PersistentViews). 
>>
>> I just see this as a starting point for what akka-persistence may require 
>> from all journal implementations in later releases: provide a persistent 
>> event stream generated several persistent actors in a scalable way. This 
>> stream could then be consumed with akka-streams or Spark Streaming, using a 
>> generic connector rather than a journal-backend-specific, for example. 
>>
>> Initially I just wanted to implement the Kafka integration as interceptor 
>> for journal commands so that events are stored in Kafka in addition to 
>> another journal backend. This may be ok for some projects, others may think 
>> that operational complexity gets too high when you have to administer a 
>> Kafka/Zookeeper cluster in addition to a Cassandra or MongoDB cluster, for 
>> example.
>>
>> Hope that clarifies things a bit.
>>
>> Cheers,
>> Martin 
>>
>>
>> On 12.07.14 15:35, Richard Rodseth wrote:
>>   
>>  I saw a tweet from Martin Krasser that he was working on an Akka 
>> Persistence journal plug-in for Kafka. This puzzled me a bit since Kafka 
>> messages are "durable" rather than "persistent" - they are stored for a 
>> configurable time. 
>>
>>  Could anyone comment on a typical usage? Assuming that your persistent 
>> actor is going to get recovered before the Kafka topic expires seems odd.
>>  
>>  While the Akka/Kafka combination seems great, I always pictured it 
>> would just involve ordinary actors playing the role of Kafka producers and 
>> consumers.
>>-- 
>> >> 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.
>>  
>>  
>> -- 
>> Martin Krasser
>>
>> blog:http://krasserm.blogspot.com
>> code:http://github.com/krasserm
>> twitter: http://twitter.com/mrt1nz
>>
>>   -- 
>>

Re: [akka-user] Kafka journal

2014-07-14 Thread Martin Krasser


On 14.07.14 16:46, Jonas Bonér wrote:

Great work Martin.


Thanks!




On Mon, Jul 14, 2014 at 4:36 PM, Martin Krasser 
mailto:krass...@googlemail.com>> wrote:


There's now a first release of the Kafka journal. Details at
https://github.com/krasserm/akka-persistence-kafka

Am Sonntag, 13. Juli 2014 16:19:55 UTC+2 schrieb Martin Krasser:


On 13.07.14 16:03, Richard Rodseth wrote:

Thanks for the detailed reply. I might have been forgetting
that Akka persistence can be used for more than persisting
DDD aggregates. I had also forgotten that the event store and
snapshot store can be different.


You can even use Kafka to implement a snapshot store. You just
need to enable log compaction
 which
will always keep the last snapshot (entry) for each persistent
actor (key). I also plan to implement a snapshot store backed
by Kafka but I'm not sure at the moment how well Kafka
supports large log entries.




On Sun, Jul 13, 2014 at 12:51 AM, Martin Krasser
 wrote:

Hi Richard,

when using the Kafka journal with default/typical
retention times, your application is responsible for
storing snapshots at intervals that are significantly
smaller than the retention time (for example, with a
retention time of 7 days, you may want to take snapshots
of your persistent actors every 3 days or so).
Alternatively, configure Kafka to keep messages "forever"
(i.e. set the retention time to the maximum value) if
needed. I don't go into Kafka partitioning details here
but it is possible to implement the journal driver in a
way that both a single persistent actor's data are
partitioned *and* kept in order. However, with the
initial implementation, all data for a single persistent
actor must fit on a single Kafka node (different
persistent actors are of course distributed over a Kafka
cluster). Hence, deleting old data after a few weeks and
taking snapshots at regular interval is the way to go
(which is good enough for many applications I think).

The real value of the Kafka journal IMO comes with the
many external integrations it supports. For example, you
can can use the it as an input source for Spark streaming


and can do (scalable) stream processing of events
generated by persistent actors i.e. you can easily create
Akka -> Kafka -> Spark Streaming pipelines. This is an
alternative to Akka's PersistentView and even allows
processing of events generated by several/all persistent
actors with a single consumer such as a single Spark
DStream (which is currently a limitation
 when using
PersistentViews).

I just see this as a starting point for what
akka-persistence may require from all journal
implementations in later releases: provide a persistent
event stream generated several persistent actors in a
scalable way. This stream could then be consumed with
akka-streams or Spark Streaming, using a generic
connector rather than a journal-backend-specific, for
example.

Initially I just wanted to implement the Kafka
integration as interceptor for journal commands so that
events are stored in Kafka in addition to another journal
backend. This may be ok for some projects, others may
think that operational complexity gets too high when you
have to administer a Kafka/Zookeeper cluster in addition
to a Cassandra or MongoDB cluster, for example.

Hope that clarifies things a bit.

Cheers,
Martin


On 12.07.14 15:35, Richard Rodseth wrote:

I saw a tweet from Martin Krasser that he was working on
an Akka Persistence journal plug-in for Kafka. This
puzzled me a bit since Kafka messages are "durable"
rather than "persistent" - they are stored for a
configurable time.

Could anyone comment on a typical usage? Assuming that
your persistent actor is going to get recovered before
the Kafka topic expires seems odd.

While the Akka/Kafka combination seems great, I always
pictured it would just involve ordinary actors playing
the role of Kafka producers and consumers.
-- 
>> Read the docs: http://akka.i

Re: [akka-user] Kafka journal

2014-07-14 Thread Jonas Bonér
Great work Martin.


On Mon, Jul 14, 2014 at 4:36 PM, Martin Krasser 
wrote:

> There's now a first release of the Kafka journal. Details at
> https://github.com/krasserm/akka-persistence-kafka
>
> Am Sonntag, 13. Juli 2014 16:19:55 UTC+2 schrieb Martin Krasser:
>>
>>
>> On 13.07.14 16:03, Richard Rodseth wrote:
>>
>> Thanks for the detailed reply. I might have been forgetting that Akka
>> persistence can be used for more than persisting DDD aggregates. I had also
>> forgotten that the event store and snapshot store can be different.
>>
>>
>> You can even use Kafka to implement a snapshot store. You just need to
>> enable log compaction
>>  which will
>> always keep the last snapshot (entry) for each persistent actor (key). I
>> also plan to implement a snapshot store backed by Kafka but I'm not sure at
>> the moment how well Kafka supports large log entries.
>>
>>
>>
>> On Sun, Jul 13, 2014 at 12:51 AM, Martin Krasser 
>> wrote:
>>
>>>  Hi Richard,
>>>
>>> when using the Kafka journal with default/typical retention times, your
>>> application is responsible for storing snapshots at intervals that are
>>> significantly smaller than the retention time (for example, with a
>>> retention time of 7 days, you may want to take snapshots of your persistent
>>> actors every 3 days or so). Alternatively, configure Kafka to keep messages
>>> "forever" (i.e. set the retention time to the maximum value) if needed. I
>>> don't go into Kafka partitioning details here but it is possible to
>>> implement the journal driver in a way that both a single persistent actor's
>>> data are partitioned *and* kept in order. However, with the initial
>>> implementation, all data for a single persistent actor must fit on a single
>>> Kafka node (different persistent actors are of course distributed over a
>>> Kafka cluster). Hence, deleting old data after a few weeks and taking
>>> snapshots at regular interval is the way to go (which is good enough for
>>> many applications I think).
>>>
>>> The real value of the Kafka journal IMO comes with the many external
>>> integrations it supports. For example, you can can use the it as an input
>>> source for Spark streaming
>>> 
>>> and can do (scalable) stream processing of events generated by persistent
>>> actors i.e. you can easily create Akka -> Kafka -> Spark Streaming
>>> pipelines. This is an alternative to Akka's PersistentView and even allows
>>> processing of events generated by several/all persistent actors with a
>>> single consumer such as a single Spark DStream (which is currently a
>>> limitation  when using
>>> PersistentViews).
>>>
>>> I just see this as a starting point for what akka-persistence may
>>> require from all journal implementations in later releases: provide a
>>> persistent event stream generated several persistent actors in a scalable
>>> way. This stream could then be consumed with akka-streams or Spark
>>> Streaming, using a generic connector rather than a
>>> journal-backend-specific, for example.
>>>
>>> Initially I just wanted to implement the Kafka integration as
>>> interceptor for journal commands so that events are stored in Kafka in
>>> addition to another journal backend. This may be ok for some projects,
>>> others may think that operational complexity gets too high when you have to
>>> administer a Kafka/Zookeeper cluster in addition to a Cassandra or MongoDB
>>> cluster, for example.
>>>
>>> Hope that clarifies things a bit.
>>>
>>> Cheers,
>>> Martin
>>>
>>>
>>> On 12.07.14 15:35, Richard Rodseth wrote:
>>>
>>>  I saw a tweet from Martin Krasser that he was working on an Akka
>>> Persistence journal plug-in for Kafka. This puzzled me a bit since Kafka
>>> messages are "durable" rather than "persistent" - they are stored for a
>>> configurable time.
>>>
>>>  Could anyone comment on a typical usage? Assuming that your persistent
>>> actor is going to get recovered before the Kafka topic expires seems odd.
>>>
>>>  While the Akka/Kafka combination seems great, I always pictured it
>>> would just involve ordinary actors playing the role of Kafka producers and
>>> consumers.
>>>--
>>> >> 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.
>>>
>>>
>>> --
>>> Martin Krasser
>>>
>>> blog: 

Re: [akka-user] Kafka journal

2014-07-14 Thread Heiko Seeberger
Fantastic!

Great work, Martin. Keep it coming!

Heiko

On 14 Jul 2014, at 16:36, Martin Krasser  wrote:

> There's now a first release of the Kafka journal. Details at 
> https://github.com/krasserm/akka-persistence-kafka
> 
> Am Sonntag, 13. Juli 2014 16:19:55 UTC+2 schrieb Martin Krasser:
> 
> On 13.07.14 16:03, Richard Rodseth wrote:
>> Thanks for the detailed reply. I might have been forgetting that Akka 
>> persistence can be used for more than persisting DDD aggregates. I had also 
>> forgotten that the event store and snapshot store can be different.
> 
> You can even use Kafka to implement a snapshot store. You just need to enable 
> log compaction which will always keep the last snapshot (entry) for each 
> persistent actor (key). I also plan to implement a snapshot store backed by 
> Kafka but I'm not sure at the moment how well Kafka supports large log 
> entries.
> 
>> 
>> 
>> On Sun, Jul 13, 2014 at 12:51 AM, Martin Krasser  
>> wrote:
>> Hi Richard,
>> 
>> when using the Kafka journal with default/typical retention times, your 
>> application is responsible for storing snapshots at intervals that are 
>> significantly smaller than the retention time (for example, with a retention 
>> time of 7 days, you may want to take snapshots of your persistent actors 
>> every 3 days or so). Alternatively, configure Kafka to keep messages 
>> "forever" (i.e. set the retention time to the maximum value) if needed. I 
>> don't go into Kafka partitioning details here but it is possible to 
>> implement the journal driver in a way that both a single persistent actor's 
>> data are partitioned *and* kept in order. However, with the initial 
>> implementation, all data for a single persistent actor must fit on a single 
>> Kafka node (different persistent actors are of course distributed over a 
>> Kafka cluster). Hence, deleting old data after a few weeks and taking 
>> snapshots at regular interval is the way to go (which is good enough for 
>> many applications I think).
>> 
>> The real value of the Kafka journal IMO comes with the many external 
>> integrations it supports. For example, you can can use the it as an input 
>> source for Spark streaming and can do (scalable) stream processing of events 
>> generated by persistent actors i.e. you can easily create Akka -> Kafka -> 
>> Spark Streaming pipelines. This is an alternative to Akka's PersistentView 
>> and even allows processing of events generated by several/all persistent 
>> actors with a single consumer such as a single Spark DStream (which is 
>> currently a limitation when using PersistentViews). 
>> 
>> I just see this as a starting point for what akka-persistence may require 
>> from all journal implementations in later releases: provide a persistent 
>> event stream generated several persistent actors in a scalable way. This 
>> stream could then be consumed with akka-streams or Spark Streaming, using a 
>> generic connector rather than a journal-backend-specific, for example. 
>> 
>> Initially I just wanted to implement the Kafka integration as interceptor 
>> for journal commands so that events are stored in Kafka in addition to 
>> another journal backend. This may be ok for some projects, others may think 
>> that operational complexity gets too high when you have to administer a 
>> Kafka/Zookeeper cluster in addition to a Cassandra or MongoDB cluster, for 
>> example.
>> 
>> Hope that clarifies things a bit.
>> 
>> Cheers,
>> Martin
>> 
>> 
>> On 12.07.14 15:35, Richard Rodseth wrote:
>>> I saw a tweet from Martin Krasser that he was working on an Akka 
>>> Persistence journal plug-in for Kafka. This puzzled me a bit since Kafka 
>>> messages are "durable" rather than "persistent" - they are stored for a 
>>> configurable time.
>>> 
>>> Could anyone comment on a typical usage? Assuming that your persistent 
>>> actor is going to get recovered before the Kafka topic expires seems odd.
>>> 
>>> While the Akka/Kafka combination seems great, I always pictured it would 
>>> just involve ordinary actors playing the role of Kafka producers and 
>>> consumers.
>>> -- 
>>> >> 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.
>> 
>> -- 
>> Martin Krasser
>> 
>> blog:http://krasserm.blogspot.com
>> code:http://github.com/krasserm
>> twitter: http://twitter.com/mrt1nz
>> -- 
>> >> Read the docs: http://akka.io/docs/
>> >>

Re: [akka-user] Kafka journal

2014-07-14 Thread Martin Krasser

Thanks Heiko, really hope to get some user feedback ...

On 14.07.14 17:04, Heiko Seeberger wrote:

Fantastic!

Great work, Martin. Keep it coming!

Heiko

On 14 Jul 2014, at 16:36, Martin Krasser > wrote:


There's now a first release of the Kafka journal. Details at 
https://github.com/krasserm/akka-persistence-kafka


Am Sonntag, 13. Juli 2014 16:19:55 UTC+2 schrieb Martin Krasser:


On 13.07.14 16:03, Richard Rodseth wrote:

Thanks for the detailed reply. I might have been forgetting that
Akka persistence can be used for more than persisting DDD
aggregates. I had also forgotten that the event store and
snapshot store can be different.


You can even use Kafka to implement a snapshot store. You just
need to enable log compaction
 which
will always keep the last snapshot (entry) for each persistent
actor (key). I also plan to implement a snapshot store backed by
Kafka but I'm not sure at the moment how well Kafka supports
large log entries.




On Sun, Jul 13, 2014 at 12:51 AM, Martin Krasser
> wrote:

Hi Richard,

when using the Kafka journal with default/typical retention
times, your application is responsible for storing snapshots
at intervals that are significantly smaller than the
retention time (for example, with a retention time of 7
days, you may want to take snapshots of your persistent
actors every 3 days or so). Alternatively, configure Kafka
to keep messages "forever" (i.e. set the retention time to
the maximum value) if needed. I don't go into Kafka
partitioning details here but it is possible to implement
the journal driver in a way that both a single persistent
actor's data are partitioned *and* kept in order. However,
with the initial implementation, all data for a single
persistent actor must fit on a single Kafka node (different
persistent actors are of course distributed over a Kafka
cluster). Hence, deleting old data after a few weeks and
taking snapshots at regular interval is the way to go (which
is good enough for many applications I think).

The real value of the Kafka journal IMO comes with the many
external integrations it supports. For example, you can can
use the it as an input source for Spark streaming

and can do (scalable) stream processing of events generated
by persistent actors i.e. you can easily create Akka ->
Kafka -> Spark Streaming pipelines. This is an alternative
to Akka's PersistentView and even allows processing of
events generated by several/all persistent actors with a
single consumer such as a single Spark DStream (which is
currently a limitation
 when using
PersistentViews).

I just see this as a starting point for what
akka-persistence may require from all journal
implementations in later releases: provide a persistent
event stream generated several persistent actors in a
scalable way. This stream could then be consumed with
akka-streams or Spark Streaming, using a generic connector
rather than a journal-backend-specific, for example.

Initially I just wanted to implement the Kafka integration
as interceptor for journal commands so that events are
stored in Kafka in addition to another journal backend. This
may be ok for some projects, others may think that
operational complexity gets too high when you have to
administer a Kafka/Zookeeper cluster in addition to a
Cassandra or MongoDB cluster, for example.

Hope that clarifies things a bit.

Cheers,
Martin


On 12.07.14 15:35, Richard Rodseth wrote:

I saw a tweet from Martin Krasser that he was working on an
Akka Persistence journal plug-in for Kafka. This puzzled me
a bit since Kafka messages are "durable" rather than
"persistent" - they are stored for a configurable time.

Could anyone comment on a typical usage? Assuming that your
persistent actor is going to get recovered before the Kafka
topic expires seems odd.

While the Akka/Kafka combination seems great, I always
pictured it would just involve ordinary actors playing the
role of Kafka producers and consumers.
-- 
>> 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
 

[akka-user] Passivate

2014-07-14 Thread Ashley Aitken

A couple of quick questions about passivate and PersistentActors:

Can other actors still send messages to persistent actors that have been 
passivated?

Will these messages cause the persistent actor to be reactivated?

I am asking about this in single node and clustered context.

I saw elsewhere that Patrik has written this in the cluster/sharding 
context:

- all messages are sent via the Manager actor, which creates child 
> Aggregate instances on demand
> - when receiving a message the Manager extract the Aggregate identifier 
> from the message
> - the Manager creates a new child Aggregate actor if it doesn't exist, and 
> then forwards the message to the Aggregate
> - the Aggregate can passivate itself by sending a Passivate message to the 
> parent Manager, which then sends PoisonPill to the Aggregate
> - in-between receiving Passivate and Terminated the Manager will buffer 
> all incoming messages for the passivating Aggregate
> - when receiving Terminated it will flush the buffer for the Aggregate, 
> which can result in activation again
> The PoisonPill can be replaced with some other custom stop message if the 
> Aggregate needs to do further interactions with other actors before 
> stopping.


Thanks in advance for any answers.

Cheers,
Ashley.


-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to 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: cascade disconnections when more than 10 clients connecting to same system

2014-07-14 Thread Vitaliy Morarian
Hi,

We have "MonitoringMaster" actor system and N "Metrics" actor systems.
They are deployed in AWS, and to make it working we are substituting 
public-ip in runtime.

Akka version: 2.2.4 (can't upgrade to 2.3.x due protobuf dependency)

Config file:
akka {
  loglevel = INFO
  log-config-on-start = on
  debug {
receive = on
lifecyle = off
  }
  actor {
provider = "akka.remote.RemoteActorRefProvider"
  }
  remote {
enabled-transports = ["akka.remote.netty.tcp"]
log-remote-lifecycle-events = INFO
netty.tcp {
  hostname = "127.0.0.1" //but we substitute a real IP in runtime
}
secure-cookie = "#"
require-cookie = on
  }
}

remote {
  untrusted-mode = on
  log-received-messages = off
}

So everything works ok when we have less than 10 clients. Problem starts to 
occur when more than 10 clients are "connecting" to master (sometimes 11, 
sometimes 15, ...).
In this case we observing cascade of exceptions (and it affects all Metrics 
systems):


*MonitoringMaster*:
[INFO] [07/14/2014 15:02:06.386] 
[MonitoringMaster-akka.actor.default-dispatcher-3] 
[akka://MonitoringMaster/user/master] Added producer 
Actor[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552/user/metric-producer#-1020796025]
 
with meta InstanceMeta(InstanceGlobalId(us-east-1,i-14ffd83e),)
[WARN] [07/14/2014 15:03:03.023] 
[MonitoringMaster-akka.actor.default-dispatcher-19] 
[akka://MonitoringMaster/system/remote-watcher] Detected unreachable: 
[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552]
[INFO] [07/14/2014 15:03:03.048] 
[MonitoringMaster-akka.actor.default-dispatcher-3] [Remoting] Address 
[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552] is now 
quarantined, all messages to this address will be delivered to dead letters.
WARN] [07/14/2014 15:03:03.060] 
[MonitoringMaster-akka.actor.default-dispatcher-3] 
[akka://MonitoringMaster/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FMetrics%40ec2-54-88-77-195.compute-1.amazonaws.com%3A2552-1866/endpointWriter]
 
AssociationError 
[akka.tcp://monitoringmas...@ec2-54-82-6-7.compute-1.amazonaws.com:2551] -> 
[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552]: Error 
[Invalid address: 
akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552] [
akka.remote.InvalidAssociation: Invalid address: 
akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552
Caused by: akka.remote.transport.Transport$InvalidAssociationException: The 
remote system has a UID that has been quarantined. Association aborted.
]
[WARN] [07/14/2014 15:03:03.061] 
[MonitoringMaster-akka.actor.default-dispatcher-3] [Remoting] Tried to 
associate with unreachable remote address 
[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552]. Address 
is now gated for 6 ms, all messages to this address will be delivered 
to dead letters. Reason: The remote system has a UID that has been 
quarantined. Association aborted.
[ERROR] [07/14/2014 15:03:06.205] 
[MonitoringMaster-akka.actor.default-dispatcher-19] 
[akka://MonitoringMaster/system/endpointManager/endpointWriter-akka.tcp%3A%2F%2FMetrics%40ec2-54-88-77-195.compute-1.amazonaws.com%3A2552-1867]
 
AssociationError 
[akka.tcp://monitoringmas...@ec2-54-82-6-7.compute-1.amazonaws.com:2551] <- 
[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552]: Error 
[Invalid address: 
akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552] [
akka.remote.InvalidAssociation: Invalid address: 
akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552
Caused by: akka.remote.transport.Transport$InvalidAssociationException: The 
remote system has quarantined this system. No further associations to the 
remote system are possible until this system is restarted.
]
[WARN] [07/14/2014 15:03:06.205] 
[MonitoringMaster-akka.actor.default-dispatcher-19] [Remoting] Tried to 
associate with unreachable remote address 
[akka.tcp://metr...@ec2-54-88-77-195.compute-1.amazonaws.com:2552]. Address 
is now gated for 6 ms, all messages to this address will be delivered 
to dead letters. Reason: The remote system has quarantined this system. No 
further associations to the remote system are possible until this system is 
restarted.



Sometimes I also see such exception:
[ERROR] [07/14/2014 15:02:47.544] 
[MonitoringMaster-akka.actor.default-dispatcher-12] [Remoting] Error 
encountered while processing system message acknowledgement [2, 3] ACK[2, 
{1, 0}] (akka.remote.transport.Transport$InvalidAssociationException)



*Metrics*:
2014-07-14 15:02:06,381  INFO [Metrics-akka.actor.default-dispatcher-17] 
d.e.m.MetricProducerActor - Successfully connected to master 
Actor[akka.tcp://monitoringmas...@ec2-54-82-6-7.compute-1.amazonaws.com:2551/user/master#-530936949]
2014-07-14 15:03:01,174  WARN [Metrics-akka.actor.default-dispatcher-15] 
a.r.RemoteWatcher - Detected unreachable: 
[akka.tcp://monitoringmas...@ec2-54-82-6-7.compute-1.amazonaws

Re: [akka-user] akka-persistence Processor emulation

2014-07-14 Thread Pavel Zalunin
Hi,

Thanks for explaining delivery semantics, actually it is in scala doc at
both trait and method description, missed it, maybe some example can fit
well in documentation:). And thanks for persistence module at all - with
2.3.2 our app works well for last few months!

Regarding deliveryIds. Two things:
1) I need to tag 'Append' with unique id, because I can send two same
messages and both should be delivered, without id I can end with:
Append(Request("example.com/r2"))
Append(Request("example.com/r1"))
Append(Request("example.com/r2"))

Remove(Request("example.com/r2"))

And last remove is confusing - I don't know which append it corresponds to
- 1st or 3rd, it can matter when receiving actor state depends on messages
ordering, thus I added id field here (uuid not a good solution probably,
but ok for testing)

2) When I receive command I need to:
  a) persist corresponding Append,
  b) make a delivery call
  c) when actor responds with Confirm, I need to persist 'Remove', that
corresponding to 'Append' persisted at a) - that is I need to know which id
has this append, as delivery id generated at b) I can't rely on it.

About pruning log. As you pointed, I can't rely on pattern
Append/Remove/Append/Remove/Append/Remove in journal, that's why I
mentioned removing all messages and storing just sequence of appends, that
I got after removing Appends with corresponding Removes after
RecoveryCompleted. Regarding removing messages based on seqId, I think it
is trickly because I need to know exact seqIds for Append/Remove in logs,
but lastSeqenceNr I can get just after successful persist event (but I'm
not sure, maybe it incremented asynchronously), so when I'm storing Append
I need to pass exact instance to persist, but I don't know seqId where it
can be stored
persist(Append(...))(_ => //here maybe I can get seqId)


Pavel.


2014-07-14 17:05 GMT+03:00 Konrad Malawski :

> This thread motivated me to improve the documentation on these methods a
> bit, progress can be tracked in this issue:
> https://github.com/akka/akka/issues/15538
>
> -- k
>
> --
> >> 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.


[akka-user] Dispatcher detach

2014-07-14 Thread Oleksandr Ryabuha
How to detach a custom dispatcher ?

-- 
>>  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] How to create typed actor router?

2014-07-14 Thread Konrad Malawski
Pull request here: https://github.com/akka/akka/pull/15540


On Mon, Jul 14, 2014 at 2:33 PM, Jonas Bonér  wrote:

>
>
>
> On Mon, Jul 14, 2014 at 1:26 PM, Konrad Malawski 
> wrote:
>
>> You know it's Victor's code if there's pigdogs inside :-)
>>
>> PS: I'm not sure if this a pattern popular enough to embrace and add it
>> to the docs... Opinions?
>>
>>
> I think it is useful enough.
> ​
>
>>
>> On Mon, Jul 14, 2014 at 1:26 PM, √iktor Ҡlang 
>> wrote:
>>
>>> <3 pigdog
>>>
>>>
>>> On Mon, Jul 14, 2014 at 1:24 PM, Konrad Malawski <
>>> konrad.malaw...@typesafe.com> wrote:
>>>
 Hello there,
 Since TypedActors are implemented as plain message sends (the message
 representing the proxy method calls is called MethodCall), you can
 simply do an untyped router, and then add a typed proxy before it:

 "TypedActor Router" must {

   "work" in {
 val t1 = newFooBar
 val t2 = newFooBar
 val t3 = newFooBar
 val t4 = newFooBar
 val routees = List(t1, t2, t3, t4) map { t ⇒ 
 TypedActor(system).getActorRefFor(t).path.toStringWithoutAddress }

 val router = system.actorOf(RoundRobinGroup(routees).props(), "router")

 val typedRouter = TypedActor(system).typedActorOf[Foo, 
 Foo](TypedProps[Foo](), router)

 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())
 info("got = " + typedRouter.optionPigdog())

 mustStop(t1)
 mustStop(t2)
 mustStop(t3)
 mustStop(t4)
   }
 }


 And with a small modification of the pigdog to include a number
 (instance value), we can see that the routing actually works:

 [info] TypedActorRouterSpec:
 [info] TypedActor Router
 [info] - must work (134 milliseconds)
 [info]   + got = Some(Pigdog-33)
 [info]   + got = Some(Pigdog-46)
 [info]   + got = Some(Pigdog-25)
 [info]   + got = Some(Pigdog-19)
 [info]   + got = Some(Pigdog-33)


 // whoa, intellij's new colorized copy paste is a bit weird. Not sure
 if awesome or just weird ;-)
 --
 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.

>>>
>>>
>>>
>>> --
>>> 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 http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> 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.
>>
>
>
>
> --
>
> *Jonas Bonér*Phone: +46 733 777 123
> Home: jonasboner.com
> 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 

Re: [akka-user] Dispatcher detach

2014-07-14 Thread Konrad Malawski
Could you give some more context about what you are trying to achieve?


On Mon, Jul 14, 2014 at 7:22 PM, Oleksandr Ryabuha  wrote:

> How to detach a custom dispatcher ?
>
> --
> >> 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,
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] Dispatcher detach

2014-07-14 Thread Oleksandr Ryabuha


I have created an executor:

public class GUIExecutorService extends AbstractExecutorService {
@Overridepublic void shutdown() {
}
@Overridepublic List shutdownNow() {
return new ArrayList<>();}
@Overridepublic boolean isShutdown() {
return false;}
@Overridepublic boolean isTerminated() {
return false;}
@Overridepublic boolean awaitTermination(long timeout, TimeUnit unit) throws 
InterruptedException {
return true;}
@Overridepublic void execute(Runnable command) {
Platform.runLater(command);}}

and configurator:

public class JavaFXEventThreadExecutorServiceConfigurator extends 
ExecutorServiceConfigurator {
public JavaFXEventThreadExecutorServiceConfigurator(Config config, 
DispatcherPrerequisites prerequisites) {
super(config, prerequisites);}
@Overridepublic ExecutorServiceFactory createExecutorServiceFactory(String id, 
ThreadFactory threadFactory) {
return () -> new GUIExecutorService(); }}

and I did use it :

this.navigatorActor = getContext().actorOf(new Props(() -> new 
NavigatorActor(stage)).withDispatcher("javafx-dispatcher"), "navigator" );

But once I want to stop in the application using:

actorSystem.shutdown();

My program still executes. 

Using last shutdown I hoped it should close all actor system.

Actor did not terminate.

What wrong with my code ?

Понеділок, 14 липня 2014 р. 21:45:15 UTC+3 користувач Konrad Malawski 
написав:
>
> Could you give some more context about what you are trying to achieve?
>
>
> On Mon, Jul 14, 2014 at 7:22 PM, Oleksandr Ryabuha  > wrote:
>
>> How to detach a custom dispatcher ?
>>
>> -- 
>> >> 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,
> 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.


[akka-user] When remote actor's JVM is killed via ^C, watchers (on different JVMs) do not get Terminated Messages

2014-07-14 Thread Ahmet Sevki
When remote actor's JVM is killed via ^C, watchers (on different JVMs) do 
not get Terminated Messages.

They get:
 Association with remote system [akka.tcp://blah@127.0.0.1:2553] has 
failed, address is now gated for [5000] ms. Reason is: [Disassociated].

I know that they get Terminated messages if the actor dies without JVM 
being killed. Here is my scenario:

I have an actor (A) that has path to actor (B). Both live on different 
jvms. Actor A sends an identity requests, gets the actor ref, and watches 
it.
Then I kill jvm shell that B runs on. 
Actor (A) never gets a Terminated message. 

I don't think it matters but actor A is spawned within Play 2.3.1

Is this normal behaviour? How can A detect that B, or B's jvm is down and 
start looking for it periodically so that it can reconnect when B is 
running again?

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] Re: When remote actor's JVM is killed via ^C, watchers (on different JVMs) do not get Terminated Messages

2014-07-14 Thread Ahmet Sevki
I forgot: Actor B in this case runs akka 2.3.0
Actor A is within a play system that runs play 2.3.1, and is running an 
akka 2.3.0 version of remote(libraryDependencies += "com.typesafe.akka" %% 
"akka-remote" % "2.3.0")

>
>

-- 
>>  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] How to tune failure-detector on high load cluster

2014-07-14 Thread Xingrun CHEN
We found that "ClusterSystem-scheduler-1" thread is very busy and consume 
50% cpu (but not more than 50%).
And we meet 'node unreachable' issue every day.
Here's our configs:

akka.cluster {
failure-detector {
  acceptable-heartbeat-pause = 6 s # default 3 s
  threshold = 12.0# default 8.0
}
scheduler {
  # make it less than system's tick-duration to force start a new one
  tick-duration = 9 ms # default 33ms
  ticks-per-wheel = 512 # default 512
}
}

akka.remote {
transport-failure-detector {
  heartbeat-interval = 30 s   # default 4s
  acceptable-heartbeat-pause = 12 s  # default 10s
}
}

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