NServiceBus/NServiceBus — comment on commit 0259e92d614660cddacd4b8e26167043037853ba
File:  line 0
By NServiceBus:

You probably need to add a ConfigureMapping for EventA to your saga.

Udi

-----Original Message-----
From: Dan Bishop [mailto:reply@reply.github.com]
Sent: Monday, December 26, 2011 2:31 AM
To: NServiceBus
Subject: Re: [NServiceBus] Sagas are now auto subscribed with an option to turn it off instead of off (0259e92)

I've got a Saga configured as follows:
public class MySaga : Saga, IAmStartedByMessages, IHandleMessages {
public void Handle(CommandA message) { }
public void Handle(EventA message) {} }

My UnicastBusConfig section contains the appropriate mapping for EventA.

My EndpointConfig is setup as follows:
Configure.WithDefaultLogging()
.StructureMapBuilder(ObjectFactory.Container)
.XmlSerializer()
.DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith(".Events"))
.RunTimeoutManager()
.RavenSagaPersister()
.Sagas();

With this configuration, the message handler for EventA in MySaga is never invoked. Here's what I know:
a) It doesn't seem to be related to unobtrusive mode. Adding an IEvent declaration to EventA doesn't change the outcome.
b) The same problem exists if I comment out the RunTimeoutManager line in the endpoint saga configuration
c) The same problem exists if I comment out the RavenSagaPersister line in the endpoint saga configuration
d) Everything starts working correctly as soon as I manually subscribe the saga endpoint to EventA

I haven't tried to set this up in a unittest, but it seems to be fairly easy to reproduce. Do you see anything obviously wrong with my configuration?

---
Reply to this email directly or view it on GitHub:
https://github.com/NServiceBus/NServiceBus/commit/0259e92d614660cddacd4b8e26167043037853ba#commitcomment-820329
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4702 - Release Date: 12/25/11