public override void AddSagasAction(IServiceCollectionBusConfigurator serviceCollectionBusConfigurator)
 {
     serviceCollectionBusConfigurator.AddSagaStateMachine <CreateDocumentStateMachine, CreateDocumentState>()
     .InMemoryRepository();
     serviceCollectionBusConfigurator.AddSagaStateMachine <UpdateDocumentStateMachine, UpdateDocumentState>()
     .InMemoryRepository();
     serviceCollectionBusConfigurator.AddSagaStateMachine <DeleteDocumentStateMachine, DeleteDocumentState>()
     .InMemoryRepository();
 }
예제 #2
0
 private static void AddSaga <TSaga, TSagaState>(IServiceCollectionBusConfigurator configuration, RedisCredentials redisCredentials) where TSaga : class, SagaStateMachine <TSagaState> where TSagaState : class, SagaStateMachineInstance, ISagaVersion
 {
     configuration.AddSagaStateMachine <TSaga, TSagaState>().RedisRepository(r =>
     {
         r.KeyPrefix = typeof(TSaga).Name;
         r.DatabaseConfiguration(redisCredentials.ConnectionString);
     });
 }
        protected override void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator)
        {
            configurator.AddSagaStateMachine <BookStateMachine, Book>()
            .InMemoryRepository();

            configurator.AddPublishMessageScheduler();

            configurator.AddSagaStateMachineTestHarness <BookStateMachine, Book>();
        }
예제 #4
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";
     });;
 }
예제 #5
0
        // 여기서는 2개의 StateMachine 이 필요.
        protected override void ConfigureMassTransit(IServiceCollectionBusConfigurator cfg)
        {
            base.ConfigureMassTransit(cfg);

            // ReservationStateMachine 에, 추가로 BookStateMachine 을 명시적으로 생성.
            cfg.AddSagaStateMachine <BookStateMachine, BookSaga>()
            .InMemoryRepository();
            cfg.AddSagaStateMachineTestHarness <BookStateMachine, BookSaga>();
        }
 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";
     });
 }
예제 #7
0
 public void ConfigureMassTransit(IServiceCollectionBusConfigurator configurator, IServiceCollection services)
 {
     configurator.AddConsumersFromNamespaceContaining <AllocateInventoryConsumer>();
     configurator.AddSagaStateMachine <AllocationStateMachine, AllocationState>(typeof(AllocateStateMachineDefinition))
     .EntityFrameworkRepository(r =>
     {
         r.AddDbContext <DbContext, AllocationStateDbContext>((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(AllocationStateDbContext)}");
             });
         });
     });
 }
예제 #8
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>();
        }
예제 #9
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>();
        }