in text....
Il giorno mercoledì 5 febbraio 2014 13:38:28 UTC+1, √ ha scritto:
>
>
>
> On Wed, Feb 5, 2014 at 1:22 PM, ccirim <[email protected] <javascript:>
> > wrote:
>
>>
>>
>> for(String nomeName : listActorName){
>>
>
> What is a listActorName and what does it contain?
>
is the list of actors'name who execute a single external job (external
service)
>
>
>>
>> final ActorRef actor = getActor(actorName);
>>
>> Patterns.ask(actor, inputMessage, Conf.sectionTimeout).
>>
>
> What is an inputMessage and how long is a sectionTimeout?
>
The input message contains the parameters for execute external job, time
out = 300 s
>
>
>> onComplete(new OnComplete<Object>() {
>>
>> @Override
>> public void onComplete(Throwable t, Object result)
>> throws Throwable {
>>
>> if(t != null){
>> do something!....
>> }
>> else{
>> do something else!....
>> }
>>
>
> Why does this section need to do an if-check on the "t" for this problem
> to manifest?
>
there are logic to say if a result job is necessary or not. after this
result is send to aggregator.
>
>
>>
>> }
>>
>> }, getContext().dispatcher());
>>
>> }
>>
>> ................
>>
>>
>> private ActorRef getActor(String actorName) {
>> Option<ActorRef> child = getContext().child(actorName);
>> if(child.isDefined())
>> return child.get();
>> else
>> return
>> getContext().actorOf(Props.create(MyServiceActor.class).withRouter(new
>> SmallestMailboxRouter(5)), actorName);
>>
>
> Does this require a MyServiceActor for the problem to manifest and what
> does a MyServiceActor do?
> Does this also require a SmallestMailboxRouter or even a Router at all to
> manifest?
>
sorry I have write wrong my code....
MyServiceActor.class is
MyServiceActor1.class
MyServiceActor2.class
MyServiceActor3.class
MyServiceActor4.class
....
one for every external service that need to run...
sample explain of my application:
my application compose same books (Principal Actor).
every book (P.A.) call an actor (secondary actor) that produce a single
chapter.
... aggregator collect chapters and return complete book
I reuse secondary actor for create chapters.
>
>> }
>>
>> ........
>>
>> ok?
>>
>> tnx!
>> carlo
>>
>>
>>
>>
>> Il giorno mercoledì 5 febbraio 2014 13:07:15 UTC+1, √ ha scritto:
>>>
>>> Hi Carlo,
>>>
>>> Can you reproduce without the SpringExt etc (i.e. is this fully
>>> minimized or not)?
>>>
>>>
>>> On Wed, Feb 5, 2014 at 1:00 PM, ccirim <[email protected]> wrote:
>>>
>>>> OK!
>>>> code sample:
>>>> ..............
>>>>
>>>> for(String nomeName : listActorName){
>>>>
>>>> final ActorRef actor = getActor(nomeName);
>>>>
>>>> Patterns.ask(actor, inputMessage,
>>>> Conf.sectionTimeout).onComplete(new
>>>> OnComplete<Object>() {
>>>>
>>>> @Override
>>>> public void onComplete(Throwable t, Object result)
>>>> throws Throwable {
>>>>
>>>> if(t != null){
>>>> do something!....
>>>> }
>>>> else{
>>>> do something else!....
>>>> }
>>>>
>>>> }
>>>>
>>>> }, getContext().dispatcher());
>>>>
>>>> }
>>>>
>>>> ................
>>>>
>>>>
>>>> private ActorRef getActor(String actorName) {
>>>> Option<ActorRef> child = getContext().child(actorName);
>>>> if(child.isDefined())
>>>> return child.get();
>>>> else
>>>> return getContext().actorOf(
>>>> SpringExtProvider.get(getContext().system()).props(actorName).withRouter(new
>>>>
>>>> SmallestMailboxRouter(4)), actorName);
>>>> }
>>>>
>>>> ........
>>>>
>>>> Ciao
>>>> Carlo
>>>>
>>>> Il giorno mercoledì 5 febbraio 2014 12:03:13 UTC+1, √ ha scritto:
>>>>>
>>>>> Please minimize the code to reproduce, and what version are you using?
>>>>>
>>>>>
>>>>> On Wed, Feb 5, 2014 at 10:48 AM, ccirim <[email protected]> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I have a strange problem when reuse an actor, (the error is random!)
>>>>>> This is my scenario:
>>>>>> - send 40 async request (messages) to my principal actor.
>>>>>> - principal actor send every single request (message) to 10 secondary
>>>>>> actors.
>>>>>> - secondary actors reply to an assembler actor who collect the
>>>>>> results and send the final result.
>>>>>>
>>>>>> I resuse every time same actor in this way:
>>>>>>
>>>>>> private ActorRef getActor(String actorName) {
>>>>>> Option<ActorRef> child = getContext().child(actorName);
>>>>>> if(child.isDefined())
>>>>>> return child.get();
>>>>>> else
>>>>>> return getContext().actorOf(SpringExtProvider.get(
>>>>>> getContext().system()).props(actorName).withRouter(new
>>>>>> SmallestMailboxRouter(4)), actorName);
>>>>>> }
>>>>>>
>>>>>> (this is "like" store actors in map or cache, its correct?!)
>>>>>>
>>>>>> and this is the error that return to me in random way at execution
>>>>>> time:
>>>>>>
>>>>>> [ERROR] [02/03/2014 18:40:19.248] [OrchestrationApplication-akka
>>>>>> .actor.default-dispatcher-2] [akka.dispatch.Dispatcher] actor name [
>>>>>> actorName1] is not unique!
>>>>>>
>>>>>> * akka.actor.InvalidActorNameException*: actor name [actorName1] is
>>>>>> not unique!
>>>>>>
>>>>>> at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer.
>>>>>> reserve(ChildrenContainer.scala:130)
>>>>>> ...
>>>>>>
>>>>>> [ERROR] [02/03/2014 18:40:19.248] [OrchestrationApplication-akka
>>>>>> .actor.default-dispatcher-2] [akka.dispatch.Dispatcher] actor name [
>>>>>> actorName2] is not unique!
>>>>>>
>>>>>> * akka.actor.InvalidActorNameException*: actor name [actorName2] is
>>>>>> not unique!
>>>>>> at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer.
>>>>>> reserve(ChildrenContainer.scala:130)
>>>>>>
>>>>>> ...
>>>>>>
>>>>>> etc etc...
>>>>>>
>>>>>> why this error? if the actor is defines (also actor name) why system
>>>>>> try to recreate actor?
>>>>>>
>>>>>> I think that if an actor dead or is stopped also his name is removed
>>>>>> of actopr system, or not?
>>>>>>
>>>>>> ps:
>>>>>>
>>>>>> my dispatcher is default dispatcher, and I have a 4 core processor
>>>>>> (i5)
>>>>>> teh default config for dispatcher is:
>>>>>>
>>>>>> fork-join-executor {
>>>>>> parallelism-min = 8
>>>>>> parallelism-factor = 3.0
>>>>>> parallelism-max = 64
>>>>>> }
>>>>>> throughput = 10
>>>>>>
>>>>>> its correct?
>>>>>>
>>>>>>
>>>>>> tnx!
>>>>>> carlo
>>>>>>
>>>>>> --
>>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou
>>>>>> p/akka-user
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Akka User List" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To post to this group, send email to [email protected].
>>>>>>
>>>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> √
>>>>>
>>>>> * ——————— **Viktor Klang*
>>>>> *Chief Architect - **Typesafe <http://www.typesafe.com/>*
>>>>>
>>>>> Twitter: @viktorklang
>>>>>
>>>> --
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>> >>>>>>>>>> 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 [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> √
>>>
>>> * ——————— **Viktor Klang*
>>> *Chief Architect - **Typesafe <http://www.typesafe.com/>*
>>>
>>> Twitter: @viktorklang
>>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>> >>>>>>>>>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Cheers,
> √
>
> * ——————— **Viktor Klang*
> *Chief Architect - **Typesafe <http://www.typesafe.com/>*
>
> Twitter: @viktorklang
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.