Automatonymous Castle Windsor Register StateMachineSagas

30 views
Skip to first unread message

hannan.go...@gmail.com

unread,
Nov 14, 2018, 12:45:14 AM11/14/18
to masstransit-discuss
Hi,

Is their a way to scan and register all the StateMachineSagas for Castle windsor , just like their is a way for Autofac and Lamar ?

var container = new WindsorContainer();


   
// register each consumer manually
    container
.Register(Component.For<YourConsumer>().LifestyleTransient());


   
//or use Windsor's excellent scanning capabilities
    container
.Register(AllTypes.FromThisAssembly().BasedOn<IConsumer>());
 
    e
.g.
   
container.Register(Component.For(typeof(ISagaRepository<>)).ImplementedBy(typeof(InMemorySagaRepository<>)));

   
container.Register(AllTypes.FromThisAssembly().BasedOn(typeof(SagaStateMachine<>)));
 
   
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
   
{
       
var host = cfg.Host(new Uri("rabbitmq://localhost/"), h =>
       
{
            h
.Username("guest");
            h
.Password("guest");
       
});


        sbc
.ReceiveEndpoint("customer_update_queue", ec =>
       
{
            ec
.EnableMessageScope();
            ec
.LoadFrom(container);
           
ec.LoadStateMachineSagasFrom(container);
       
})
   
});


    container
.Register(Component.For<IBus>().Instance(busControl));
    container
.Register(Component.For<IBusControl>().Instance(busControl));

Is the above possible with windsor ? I read there were some  scope related issues previously with windsor , is that still the case ?

Regards,
Hannan

Chris Patterson

unread,
Nov 14, 2018, 10:42:54 AM11/14/18
to masstrans...@googlegroups.com
I'm not sure if an extension library for Automatonymous/Windsor exists, but it should be possible using the existing ones as a starting point.


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/76b97ea1-53ed-4378-9572-abf003d47c2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hannan.go...@gmail.com

unread,
Nov 14, 2018, 5:38:22 PM11/14/18
to masstransit-discuss
Thanks Chris, i'll have a look.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.

hannan.go...@gmail.com

unread,
Nov 16, 2018, 12:07:09 AM11/16/18
to masstransit-discuss
Hi Chris, 

I quickly wrote the extensions for Castle Windsor to allow Scanning and registering StateMachineSagas. 


If possible please review and provide feedback.

Thanks.

Regards,
Hannan
Reply all
Reply to author
Forward
0 new messages