Note that there are some explanatory texts on larger screens.

plurals
  1. PONServiceBus, Could not find a saga for the message type
    primarykey
    data
    text
    <p>My saga below is not handling the ValidateRegistration and ValidateRegistration commands. I see the "Could not find a saga for the message type Registrations.Messages.ValidateRegistration with id ..." message.</p> <p>Is my configuration to find saga not correct? Please help!</p> <p>Thanks</p> <p>PS: I am using the generic host in the registration process and I am using NServiceBus.Lite profile.</p> <pre><code>public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization { #region Implementation of IWantCustomInitialization public void Init() { var kernel = new StandardKernel(); kernel.Load(new BackendModule()); //Configure.Instance.Configurer.ConfigureProperty&lt;RegistrationSaga&gt;(x =&gt; x.Factory, kernel.Get&lt;IAggregateRootFactory&gt;()); Configure.With().NinjectBuilder(kernel); } #endregion } public class RegistrationSagaData : IContainSagaData { #region Implementation of ISagaEntity public virtual Guid Id { get; set; } public virtual string Originator { get; set; } public virtual string OriginalMessageId { get; set; } public virtual RegistrationID RegistrationID { get; set; } public virtual bool IsValidated { get; set; } public virtual string RegistrationType { get; set; } #endregion } public class RegistrationSaga : Saga&lt;RegistrationSagaData&gt;, IAmStartedByMessages&lt;StartRegistration&gt;, IHandleMessages&lt;ValidateRegistration&gt;, IHandleMessages&lt;CancelRegistration&gt; { public RegistrationFactory Factory { get; set; } public override void ConfigureHowToFindSaga() { ConfigureMapping&lt;StartRegistration&gt;(data =&gt; data.RegistrationID, registration =&gt; registration.ID); ConfigureMapping&lt;ValidateRegistration&gt;(data =&gt; data.RegistrationID, registration =&gt; registration.ID); ConfigureMapping&lt;CancelRegistration&gt;(data =&gt; data.RegistrationID, registration =&gt; registration.ID); } #region Implementation of IMessageHandler&lt;StartRegistration&gt; public void Handle(StartRegistration message) { Data.IsValidated = false; Data.RegistrationType = message.RegistrationType; Bus.SendLocal(new CreateRegistration { RegistrationType = message.RegistrationType, ID = message.ID }); Console.WriteLine("======&gt; handled StartRegistration"); } #endregion #region Implementation of IMessageHandler&lt;ValidateRegistration&gt; public void Handle(ValidateRegistration message) { MarkAsComplete(); Console.WriteLine("======&gt; handled ValidateRegistration"); } #endregion #region Implementation of IMessageHandler&lt;CancelRegistration&gt; public void Handle(CancelRegistration message) { Console.WriteLine("======&gt; handled CancelRegistration"); MarkAsComplete(); } #endregion } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload