On Thu, Mar 20, 2014 at 1:24 PM, Sendhil Kumar M <[email protected]>wrote:

> I am using akka 2.3.0 and this is how i am creating the CHR.
>
>
> So my req is that which ever message went to a routee of TestConnActor
> they should all be consolidated as list in the Aggregator actor.
>
>
>
> So if message 1 and 2 made it to TestConnActor  routee1 and message 3 and
> 4 made it to TestConnActor routee2 then when the messages 1 and 2 should
> reach the same routee of the Aggregator actor. Please suggest me if its
> doable with CHR.
>
but TestQuant and TestAgg don't have any routees in common. Both of them
create 3 separate routees each.

You are using a deprecated API. This is now named ConsistentHashingPool. I
think you might be looking for ConsistentHashingGroup. The differences
between Pool and Group are described in the documentation:
http://doc.akka.io/docs/akka/2.3.0/java/routing.html

Take a look at that and let me know if things still are unclear.

/Patrik


>
>
> TestHashMapper  just uses one of the incoming message's id and returns
> that as hash key.
>
> TestHashMapper hashMapper =
> *new* TestHashMapper();
>
> actorSystem().actorOf(Props.*create*(TestConnActor.
>
> *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)).
> *withHashMapper(hashMapper)*), "TestQuant" );
>
> actorSystem().actorOf(Props.*create*(TestEventAggregator.
> *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)).
> *withHashMapper(hashMapper)*), "TestAgg" );
>
> actorSystem().actorOf(Props.*create*(TestBulkActor.
> *class*).withRouter(*new* *ConsistentHashingRouter( **new* Integer(3)).
> *withHashMapper(hashMapper)*), "TestBulk" );
>
>  ActorRef single = actorSystem().actorOf(
> *new* RoundRobinPool(3).props(Props.*create*(TestSingleActor.*class*)),
> "TestSingle");
>
>
>
>
>
>
>
>
>
> ~
>
>
>
>
> On Thursday, March 20, 2014 3:14:03 AM UTC-4, Patrik Nordwall wrote:
>
>> What version of Akka are you using? How do you create the CHR?
>> /Patrik
>>
>>
>> On Wed, Mar 19, 2014 at 10:35 PM, Sendhil Kumar M <[email protected]>wrote:
>>
>>>  I have implemented two CHR where one Router has 20 routees of Actor B
>>> and another CHR router with 5 routees and both these Routers uses the Same
>>> hashMapper which uses part of the incoming message to build it.
>>>
>>> Input message:
>>> 1
>>> 2
>>> 3
>>> 4
>>> 5
>>>
>>> Actor A calls CHR of Actor B
>>> routee 1 of Actor B gets 1 and 2
>>>  routee 2 of Actor B gets 3 and 4
>>>  routee 3 of Actor B gets 5
>>>
>>>
>>> Now Actor B calls Actor C's CHR using the hash mapper returing the same
>>> key.
>>>
>>> Expected result:
>>>  routee 1 of Actor B gets 1 and 2
>>>  routee 2 of Actor B gets 3 and 4
>>>  routee 3 of Actor B gets 5
>>>
>>> But i am seeing this.
>>>  routee 1 of Actor B gets 1 and 3
>>>  routee 2 of Actor B gets 2 and 5
>>>  routee 3 of Actor B gets 4
>>>
>>>
>>> I see th CHR is consistently passing the messages with the same key into
>>> same actor with a set of routees of same actors. But i am not seeing the
>>> same messages going to one routee of another actor with another CHR. The
>>> messages are going to different routees for the same hash key.
>>>
>>>
>>> Can someone please explain how the consistent hashing router is
>>> implemented? What are the factors it uses to build the hashing and how it
>>> routes?
>>>
>>>
>>>
>>>
>>> --
>>> >>>>>>>>>> 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 [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/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Patrik Nordwall
>> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
>> Twitter: @patriknw
>>
>>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [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/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [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/d/optout.

Reply via email to