Thanks for response.

I have found following solution:

    val strRouter = 
context.actorOf(Props(*new*RoundRobinEventBusSubscriber[StrSubscriber]))
>     val intRouter = 
> context.actorOf(Props(*new*RoundRobinEventBusSubscriber[IntSubscriber]))


Cheers

Am Montag, 24. Februar 2014 23:29:19 UTC+1 schrieb √:
>
> You're not passing in the ClassTag in the Props for the 
> RoundRobinEventBusSubscriber's 
> constructor.
>
>
> On Mon, Feb 24, 2014 at 11:17 PM, Christian Thomas 
> <[email protected]<javascript:>
> > wrote:
>
>> Finally I have found the option to remove the other post. ( At the first 
>> time I did not have seen, that post will be checked before published - so I 
>> thought, some errors were occurred ).
>> ...
>> Okay, back to my problem. Does somebody have any ideas?
>>
>> Thanks.
>>
>>
>> Kind regards
>>
>> Christian
>>
>>
>>
>>
>>
>> Am Montag, 24. Februar 2014 21:30:59 UTC+1 schrieb √:
>>>
>>> You double-posted the apology :(
>>>
>>>
>>> On Mon, Feb 24, 2014 at 9:16 PM, Christian Thomas <[email protected]>wrote:
>>>
>>>> Sorry for the double post :-(
>>>>
>>>> Am Montag, 24. Februar 2014 20:05:38 UTC+1 schrieb Christian Thomas:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm new to AKKA and I really like it! It is a create framework. 
>>>>> Acutally I have build an example, where I'm using the akka Eventbus. My 
>>>>> requirement is to say, that I want to have subscribers, that are handled 
>>>>> by 
>>>>> akka routing techniques to simply provide more than one actor, that will 
>>>>> do 
>>>>> the work implemented in the subscriber.
>>>>>
>>>>> You can find the example here at my github repo.
>>>>> Here the full source code
>>>>>
>>>>> Here some snippets:
>>>>>
>>>>> trait Msg
>>>>>> case class StrMsg(str: String) extends Msg
>>>>>> case class IntMsg(int: Int) extends Msg
>>>>>> ....
>>>>>>   val strRouter = context.actorOf(Props[RoundRobinEventBusSubscriber[
>>>>>> StrSubscriber]])     
>>>>>>  val intRouter = context.actorOf(Props[RoundRobinEventBusSubscriber[
>>>>>> IntSubscriber]]) 
>>>>>> ...
>>>>>> for (i <- 1 to 50) context.system.eventStream.publish(StrMsg("STR 
>>>>>> MSG NO %d" format i))
>>>>>> ...
>>>>>
>>>>>
>>>>>
>>>>> The following class should create the router according to given T and 
>>>>> subscribe to the event-stream. If some Msg's are available, these 
>>>>> messages 
>>>>> have to be banged to the router, that will do the work. This class I want 
>>>>> to reuse for different concrete subscribers ( see code above )
>>>>>
>>>>>
>>>>> class RoundRobinEventBusSubscriber[T <: Actor: ClassTag] extends Actor 
>>>>>> { // <-------------------------------------------
>>>>>>   
>>>>>>   private val routees = context.actorOf(RoundRobinPool
>>>>>> (5).props(Props[T])) // <-----------------------------------------
>>>>>>   override def preStart {
>>>>>>     super.preStart
>>>>>>     context.system.eventStream.subscribe(context.self, classOf[Msg])
>>>>>>   }
>>>>>>   override def postStop {
>>>>>>     context.system.eventStream.unsubscribe(context.self, 
>>>>>> classOf[Msg])
>>>>>>     super.postStop
>>>>>>   }
>>>>>>   def receive = { case msg: Msg => routees ! msg }
>>>>>>   
>>>>>> } 
>>>>>> ....
>>>>>> class StrSubscriber extends Actor {
>>>>>>   
>>>>>>   def receive = {
>>>>>>     case StrMsg(str) => println("StrSubscriber %s receives %s" format 
>>>>>> (self.path.name, str))
>>>>>>   }
>>>>>>   
>>>>>> }
>>>>>> ...
>>>>>
>>>>>
>>>>> Here the error, that I will get:
>>>>>
>>>>>> [akka-robin-bus-akka.actor.default-dispatcher-3] 
>>>>>> [akka://akka-robin-bus/user/$a] no matching constructor found on 
>>>>>> class de.examples.RoundRobinEventBusSubscriber for arguments []
>>>>>> java.lang.IllegalArgumentException: no matching constructor found on 
>>>>>> class de.examples.RoundRobinEventBusSubscriber for arguments []
>>>>>>  at akka.util.Reflect$.error$1(Reflect.scala:82)
>>>>>> at akka.util.Reflect$.findConstructor(Reflect.scala:106)
>>>>>
>>>>>
>>>>>
>>>>> I have googled for it, but I have not found any solution for it. What 
>>>>> I have to do, Feel free to use the published sample at my Github ( see 
>>>>> link 
>>>>> at the beginning ) if needed.
>>>>>
>>>>> Is there maybe another "Akka way" to perform something like this here?
>>>>>
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Cheers!
>>>>>
>>>>> Christian
>>>>>
>>>>>  -- 
>>>> >>>>>>>>>> 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.

Reply via email to