Oh,And what are your reasons to move from NSB to RSB?

On Fri, Jul 31, 2009 at 5:09 AM, Ayende Rahien <[email protected]> wrote:

> Tyler,No, RSB doesn't support this right now.
> It should be pretty easy to patch, though. Take a look at
> DefaultServiceBus.GatherConsumers()
>
>
> On Fri, Jul 31, 2009 at 1:44 AM, tyler.burd <[email protected]> wrote:
>
>>
>> Hi there.  I'm converting an application from NServiceBus to Rhino
>> Service Bus, and I'm hung up on one thing.  In NSB you can create a
>> MessageHandler that handles an interface.  Something like this:
>>
>> public class MySpecialMessageHandler :
>> IMessageHandler<IAmASpecialMessage>
>>
>> NSB then calls this handler whenever it receives a message that
>> implements the "IAmASpecialMessage" interface.  I can't recreate this
>> behavior in RSB.  I tried the following:
>>
>> public class SpecialMessageConsumer : ConsumerOf<ISpecialMessage>
>> {
>>        public void Consume(ISpecialMessage message)
>>        {
>>                Console.WriteLine(string.Format("Consumed message of type :
>> {0}",
>> message.GetType().Name));
>>        }
>> }
>>
>> public class MySpecialMessage1 : ISpecialMessage {}
>> public class MySpecialMessage2 : ISpecialMessage {}
>>
>> //code to initialize RSB and a windsor container
>> container.AddComponent<SpecialMessageConsumer>();
>> bus.Start();
>> bus.Send(bus.Endpoint, new MySpecialMessage1());
>> bus.Send(bus.Endpoint, new MySpecialMessage2());
>>
>> This never results in a message being consumed, and the log shows
>> "ERROR - Got message RsbTest.MySpecialMessage2, but had no consumers
>> for it"
>>
>> Is this possible?  Is there another way to handle this?
>>
>> Thanks!
>> -tyler burd
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to