RSB is doing polymorphic dispatch here for TestClass and TestSubClass,
so you could have separate handlers for both types if you wanted, and
since you're telling RSB that TestConsumer consumes both types it's
calling that consumer twice. Just change that consumer to one type or
the other.

On Wed, Jan 19, 2011 at 10:28 AM, Scott <[email protected]> wrote:
> I have a couple of scenarios using RSB where I want to handle a
> message by consuming it and determining at what time in the future I
> want to handle it.  I can then call bus.DelaySend(...) to handle the
> timing.  I love that feature!
>
> The problem I encountered is when using a message which is a subclass
> of another message:
>
> public class TestClass { public string Foo { get; set; }
> public class TestSubClass { }
>
> If my consumer class is
>
> public class TestConsumer : ConsumerOf<TestClass>,
> CosumerOf<TestSubClass>
>
> then when a message arrives of type TestSubClass, the
> Consume(TestSubClass) method is called twice.
>
> At least in my mind, this is not expected behavior.  Is this a bug, or
> just a misplaced expectation on my part?
>
> Thanks.
>
> --
> 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.
>
>

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