Both Start and Timeout actually do implement ISagaMessage

Dana utorak, 10. srpnja 2012. 17:04:24 UTC+2, korisnik Scott napisao je:
>
> I've had this problem with sagas in the past. Usually the resolution is to 
> make sure your Timeout message actually implements the ISagaMessage 
> interface, instead of just having a CorrelationId property in the class.
>
> It's an easy mistake to make, and I've done it more than once.
>
>
>
> On Tuesday, July 10, 2012 8:58:01 AM UTC-6, Ivica Munitic wrote:
>>
>> Sorry for the email, I clicked the wrong button somewhere :)
>>
>> Here is the BootStrapper:
>>
>>     public class BootStrapper : AutofacBootStrapper
>>     {
>>         protected override void ConfigureContainer()
>>         {
>>             base.ConfigureContainer();
>>
>>             var builder = new ContainerBuilder();
>>             
>> builder.RegisterGeneric(typeof(InMemorySagaPersister<>)).As(typeof(ISagaPersister<>));
>>             builder.Update(Container);
>>         }
>>
>>         protected override void OnBeginStart()
>>         {
>>             base.OnBeginStart();
>>
>>             XmlConfigurator.Configure();
>>         }
>>     }
>>
>> and here is the configuration of the bus
>>
>> <?xml version="1.0" encoding="utf-8" ?>
>> <configuration>
>>   <configSections>
>>     <section name="rhino.esb" 
>> type="Rhino.ServiceBus.Config.BusConfigurationSection, Rhino.ServiceBus"/>
>>     <section name="log4net" 
>> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
>>   </configSections>
>>
>>   <rhino.esb>
>>     <bus threadCount="1" numberOfRetries="5" 
>> endpoint="msmq://localhost/rsb-retention" transactional="false" />
>>     <messages>
>>       <add name="MyNamespace.Timeout" 
>> endpoint="msmq://localhost/rsb-retention" transactional="false" />
>>     </messages>
>>   </rhino.esb>
>>
>>   <log4net>
>>     <appender name="ConsoleAppender" 
>> type="log4net.Appender.ConsoleAppender">
>>       <layout type="log4net.Layout.PatternLayout">
>>         <conversionPattern value="%date [%thread] %-5level [%ndc] - 
>> %message%newline"/>
>>       </layout>
>>     </appender>
>>     <root>
>>       <level value="DEBUG"/>
>>       <appender-ref ref="ConsoleAppender"/>
>>     </root>
>>   </log4net>
>>   <runtime>
>>     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
>>       <dependentAssembly>
>>         <assemblyIdentity name="Rhino.Queues" 
>> publicKeyToken="0b3305902db7183f" culture="neutral" />
>>         <bindingRedirect oldVersion="0.0.0.0-1.4.1.0" 
>> newVersion="1.4.2.0"/>
>>       </dependentAssembly>
>>     </assemblyBinding>
>>   </runtime>
>> </configuration>
>>
>>
>> The assembly binding is because Rhino.ServiceBus.Host.exe works with 
>> Rhino.Qieies 1.4.1.0 :)
>>
>> Regards, Ivica
>> Dana utorak, 10. srpnja 2012. 16:43:33 UTC+2, korisnik Corey napisao je:
>>>
>>> Which container? How are the consumers getting registered? Test code? 
>>> Your sample *should* work fine so the problem is likely with the container 
>>> or test code.
>>>
>>> On Tue, Jul 10, 2012 at 8:20 AM, Ivica Munitic <[email protected]>wrote:
>>>
>>>> Hello, I have a saga like this
>>>>
>>>>     public class MySaga
>>>>         : ISaga<MySagaState>,
>>>>         InitiatedBy<Start>,
>>>>         Orchestrates<Timeout>
>>>>     {
>>>>         readonly IServiceBus _bus;
>>>>
>>>>         public MySagaState State { get; set; }
>>>>
>>>>         public Guid Id { get; set; }
>>>>         public bool IsCompleted { get; set; }
>>>>
>>>>         public MySaga(IServiceBus bus)
>>>>         {
>>>>             _bus = bus;
>>>>             this.State = new MySagaState();
>>>>         }
>>>>
>>>>         public void Consume(Start message)
>>>>         {
>>>>             State.ActivityId = message.ActivityId;
>>>>             _bus.DelaySendToSelf(DateTime.Now.AddSeconds(10), new 
>>>> Timeout() { CorrelationId = this.Id });
>>>>
>>>>         }
>>>>
>>>>         public void Consume(Timeout message)
>>>>         {
>>>>             _bus.Publish(new Expired() { ActivityId = State.ActivityId 
>>>> });
>>>>
>>>>             IsCompleted = true;
>>>>         }
>>>>     }
>>>>
>>>> The problem I'm having is that the saga never consumes the Timeout 
>>>> message.
>>>> the timeout message finishes in the discarded subqueue.
>>>> The logs says that it did not get processed because there were no 
>>>> cosumers for it.
>>>>
>>>> I'm really confused.
>>>>
>>>> P.S.
>>>>
>>>> I'm using an InMemorySagaPersister to test this saga.
>>>>
>>>>
>>>>
>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Rhino Tools Dev" group.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msg/rhino-tools-dev/-/ZXvSpUGLfIMJ.
>>>> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/rhino-tools-dev/-/Ux7mVezhEWkJ.
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