There is likely a bug right around here then.

https://github.com/hibernating-rhinos/rhino-esb/blob/master/Rhino.ServiceBus.Autofac/AutofacServiceLocator.cs#L40


On Tue, Jul 10, 2012 at 9:13 AM, Ivica Munitic <[email protected]> wrote:

> I've put this in ConfigureContainer in the BootStrapper (of the saga)
>
> var o = Container.Resolve<Orchestrates<Timeout>>();
>
> and got this exception when i run it.
>
> The requested service
> 'Rhino.ServiceBus.Sagas.Orchestrates`1[[MyNamespace.Timeout, MyNamespace,
> Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' has not been
> registered. To avoid this exception, either register a component to provide
> the service, check for service registration using IsRegistered(), or use
> the ResolveOptional() method to resolve an optional dependency.
>
> Dana utorak, 10. srpnja 2012. 17:08:19 UTC+2, korisnik Corey napisao je:
>
>> Try in your test code to resolve an instance of Orchestrates<Timeout>. If
>> it doesn't resolve it could be a bug in the Autofac container.
>>
>> On Tue, Jul 10, 2012 at 9:04 AM, Scott <[email protected]> wrote:
>>
>>> 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.**Log4NetCo**
>>>> nfigurationSectionHan**dler, 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.**Console**
>>>> Appender">
>>>>       <layout type="log4net.Layout.**PatternLa**yout">
>>>>         <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-**c**om:asm.v1">
>>>>       <dependentAssembly>
>>>>         <assemblyIdentity name="Rhino.Queues" publicKeyToken="**
>>>> 0b3305902db718**3f" 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/
>>>>>> **ms**g/rhino-tools-dev/-/**ZXvSpUGLfI**MJ<https://groups.google.com/d/msg/rhino-tools-dev/-/ZXvSpUGLfIMJ>
>>>>>> .
>>>>>> To post to this group, send email to rhino-tools-dev@googlegroups.**c
>>>>>> **om <[email protected]>.
>>>>>> To unsubscribe from this group, send email to
>>>>>> rhino-tools-dev+unsubscribe@**go**oglegroups.com<rhino-tools-dev%[email protected]>
>>>>>> .
>>>>>> For more options, visit this group at http://groups.google.com/**
>>>>>> group**/rhino-tools-dev?hl=en<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/-/**ibB9qIxFOm8J<https://groups.google.com/d/msg/rhino-tools-dev/-/ibB9qIxFOm8J>
>>> .
>>>
>>> To post to this group, send email to 
>>> rhino-tools-dev@googlegroups.**com<[email protected]>
>>> .
>>> To unsubscribe from this group, send email to
>>> rhino-tools-dev+unsubscribe@**googlegroups.com<rhino-tools-dev%[email protected]>
>>> .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/rhino-tools-dev?hl=en<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/-/vfvD42DANkMJ.
>
> 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