Configuring Lamar

MassTransit supports Lamar, the successor to StructureMap, created by Jeremy D. Miller.

Support requires an additional NuGet package, MassTransit.Lamar, which is available using NuGet. For state machine support, add the MassTransit.Automatonymous.Lamar package.

A sample project for the container registration code is available on GitHub.

public static void Main(string[] args)
    var container = new Container(cfg =>
        cfg.AddMassTransit(x =>
            // add a specific consumer

            // add all consumers in the specified assembly

            // add consumers by type
            x.AddConsumers(typeof(ConsumerOne), typeof(ConsumerTwo));

            // add the bus to the container, may need to create Local function
            x.AddBus(context => Bus.Factory.CreateUsingRabbitMq(cfg =>
                var host = cfg.Host("localhost/");

                cfg.ReceiveEndpoint("customer_update", ec =>
                    // Configure a single consumer

                    // configure all consumers

                    // configure consumer by type
                    ec.ConfigureConsumer(typeof(ConsumerOne), context);

                // or, configure the endpoints by convention

    IBusControl busControl = container.GetInstance<IBusControl>();

results matching ""

    No results matching ""