_bus = Bus.Factory.CreateUsingAzureServiceBus(x =>{ var host = x.Host(...);
x.ReceiveEndpoint("orders", e =>{ e.Consumer<AddOrderConsumer>(); e.Consumer<SendOrderReceipt>(); });
x.ReceiveEndpoint("users", e => { e.Consumer<AddAccountConsumer>(); e.Consumer<SendWelcomeEmail>(); });});
var builder = new ContainerBuilder();
builder.RegisterType<AddOrderConsumer>();builder.RegisterType<SendOrderReceipt>();builder.RegisterType<AddAccountConsumer>();builder.RegisterType<SendWelcomeEmail>();builder.Register(context =>{ return Bus.Factory.CreateUsingAzureServiceBus(cfg => {
var host = cfg.Host(...);
cfg.ReceiveEndpoint("orders", ec => { ec.LoadFrom(context); });
cfg.ReceiveEndpoint("users", ec => { // uhhhh }); });}) .SingleInstance() .As<IBusControl>() .As<IBus>();
--
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/c3edae61-1c18-4d6a-a0d1-cbe7097c5028%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
var builder = new ContainerBuilder();
builder.RegisterType<AddOrderConsumer>();builder.RegisterType<SendOrderReceipt>();builder.RegisterType<AddAccountConsumer>();builder.RegisterType<SendWelcomeEmail>();builder.Register(context =>{ return Bus.Factory.CreateUsingAzureServiceBus(cfg => {
var host = cfg.Host(...);
cfg.ReceiveEndpoint("orders", ec =>
{
ec.Consumer<AddOrderConsumer>(context.Resolve<ILifetimeScope>());
ec.Consumer<SendOrderReceipt>(context.Resolve<ILifetimeScope>());
});
cfg.ReceiveEndpoint("users", ec => {
ec.Consumer<AddAccountConsumer>(context.Resolve<ILifetimeScope>());
ec.Consumer<SendWelcomeEmail>(context.Resolve<ILifetimeScope>());
}); });}) .SingleInstance() .As<IBusControl>() .As<IBus>();
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
var autofacBuilder = new ContainerBuilder();
ILifetimeScope customerOrdersScope;ILifetimeScope someOtherScope;
builder.Register(af => Bus.Factory.CreateUsingRabbitMq(x => { var host = x.Host(broker, h => { h.Username(rabbitUser); h.Password(rabbitPass); });
x.UseNLog(); x.UseJsonSerializer();
x.ReceiveEndpoint(ordersQueue, r => { r.LoadFrom(customerOrdersScope); });
x.ReceiveEndpoint(otherQueue, r => { r.LoadFrom(someOtherScope); }); })
).As<IBusControl>().As<IBus>().SingleInstance();
var container = autofacBuilder.Build();
customerOrdersScope = container.BeginLifetimeScope(c =>{ c.RegisterModule(new OrdersModule());});
someOtherScope = container.BeginLifetimeScope(c =>{ c.RegisterModule(new SomeOtherModule());});
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/c3edae61-1c18-4d6a-a0d1-cbe7097c5028%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/34581268-4216-4023-81ca-139cfbf9bcc8%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@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/c3edae61-1c18-4d6a-a0d1-cbe7097c5028%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-discuss+unsub...@googlegroups.com.
After watching Greg Young's "Eight lines of code" I am seriously considering getting rid of the container and using function composition. This is especially attractive because I believe MassTransit is also build this way, using pipelines.
--
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-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/030252ca-3740-4014-8e7e-f83febda069e%40googlegroups.com.
After watching Greg Young's "Eight lines of code" I am seriously considering getting rid of the container and using function composition. This is especially attractive because I believe MassTransit is also build this way, using pipelines.
--
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/030252ca-3740-4014-8e7e-f83febda069e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The MassTransit Host is definitely moving in the direction of making it easier to do this type of thing, and it will get some enhancements. The container support is jank, it assumes small isolated services and it turns out that people are still building monoliths with a giant single container. The nested scope option is great, and is the approach the MassTransit Host uses - I just need to make the discovery a little smarter. Group by namespace, etc. so that multiple endpoints are easy to create within the same assembly.And yes, MT is all about functional composition versus container use :)
On Wed, Oct 26, 2016 at 10:40 AM, Alexey Zimarev <azim...@gmail.com> wrote:
After watching Greg Young's "Eight lines of code" I am seriously considering getting rid of the container and using function composition. This is especially attractive because I believe MassTransit is also build this way, using pipelines.
--
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-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.