示例#1
0
        public void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator, IServiceCollection services)
        {
            services.AddScoped <AcceptOrderActivity>();

            configurator.AddConsumersFromNamespaceContaining <SubmitOrderConsumer>();
            configurator.AddActivitiesFromNamespaceContaining <AllocateInventoryActivity>();
            configurator.AddConsumersFromNamespaceContaining <RoutingSlipBatchEventConsumer>();

            configurator.AddSagaStateMachine <OrderStateMachine, OrderState>(typeof(OrderStateMachineDefinition))
            .MongoDbRepository(r =>
            {
                r.Connection   = "mongodb://mongo";
                r.DatabaseName = "orders";
            });

            configurator.AddRequestClient <AllocateInventory>();
        }
示例#2
0
 public void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator, IServiceCollection services)
 {
     configurator.AddConsumersFromNamespaceContaining <AllocateInventoryConsumer>();
     configurator.AddSagaStateMachine <AllocationStateMachine, AllocationState>(typeof(AllocateStateMachineDefinition))
     .MongoDbRepository(cfg => {
         cfg.Connection   = "mongodb://mongo";
         cfg.DatabaseName = "allocations";
     });;
 }
 public void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator, IServiceCollection services)
 {
     configurator.AddConsumersFromNamespaceContaining <AllocateInventoryConsumer>();
     configurator
     .AddSagaStateMachine <AllocationStateMachine, AllocationState>(typeof(AllocateStateMachineDefinition))
     .MongoDbRepository(r =>
     {
         r.Connection   = "mongodb://172.20.0.25:27017";  //mongodb://mongo doesnt work. Changed to docker machine ip address
         r.DatabaseName = "allocations";
     });
 }
示例#4
0
        public void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator, IServiceCollection services)
        {
            services.AddScoped <AcceptOrderActivity>();

            configurator.AddConsumersFromNamespaceContaining <SubmitOrderConsumer>();
            configurator.AddActivitiesFromNamespaceContaining <AllocateInventoryActivity>();
            configurator.AddConsumersFromNamespaceContaining <RoutingSlipBatchEventConsumer>();

            configurator.AddSagaStateMachine <OrderStateMachine, OrderState>(typeof(OrderStateMachineDefinition))
            .EntityFrameworkRepository(r =>
            {
                r.AddDbContext <DbContext, OrderStateDbContext>((provider, builder) =>
                {
                    builder.UseSqlServer("Server=tcp:gertjvr.database.windows.net,1433;Initial Catalog=gertjvr;Persist Security Info=False;User ID=gertjvr;Password=Works4me!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;", m =>
                    {
                        m.MigrationsAssembly(Assembly.GetExecutingAssembly().GetName().Name);
                        m.MigrationsHistoryTable($"__{nameof(OrderStateDbContext)}");
                    });
                });
            });

            configurator.AddRequestClient <AllocateInventory>();
        }
示例#5
0
        public void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator, IServiceCollection services)
        {
            services.AddScoped <AcceptOrderActivity>();
            services.AddScoped <RoutingSlipBatchEventConsumer>();

            configurator.AddConsumersFromNamespaceContaining <SubmitOrderConsumer>();
            configurator.AddActivitiesFromNamespaceContaining <AllocateInventoryActivity>();

            configurator.AddConsumer <RoutingSlipBatchEventConsumer>(x => x.Options <BatchOptions>(b => b.SetMessageLimit(10).SetTimeLimit(s: 1)));

            configurator.AddSagaStateMachine <OrderStateMachine, OrderState>(typeof(OrderStateMachineDefinition)).MongoDbRepository(cfg => {
                cfg.Connection   = "mongodb://mongo";
                cfg.DatabaseName = "orderdb";
            });

            configurator.AddRequestClient <AllocateInventory>();
        }
 public void RegisterConsumers(IServiceCollectionBusConfigurator configurator)
 {
     configurator.AddConsumersFromNamespaceContaining <SecurityBusRegistry>();
 }