Beispiel #1
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToCommand <CreateUser>()
     .Build().Run();
 }
Beispiel #2
0
        public static void Initialize()
        {
            if (_configured)
            {
                return;
            }

            var builder = new ConfigurationBuilder()
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          // .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddEnvironmentVariables()
                          .SetBasePath(Directory.GetCurrentDirectory());

            Configuration = builder.Build();
            LifetimeScope = GetLifetimeScope();
            ServiceHost
            .Create <Program>()
            .UseAutofac(LifetimeScope)
            .UseRabbitMq(queueName: typeof(Program).Namespace)
            .SubscribeToCommand <SpawnWarden>()
            .SubscribeToCommand <StartWarden>()
            .SubscribeToCommand <StopWarden>()
            .SubscribeToCommand <PauseWarden>()
            .SubscribeToCommand <PingWarden>()
            .SubscribeToCommand <KillWarden>()
            .Build()
            .Run();
            _configured = true;
        }
Beispiel #3
0
 public static void Main(string[] args)
 {
     ServiceHost.Create(new DefaultContainerAdapter())
     .Logging(x => x.ColoredConsole())
     .ServiceFinder(x => x.ServicesInAssemblyOfType <Program>())
     .Run();
 }
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .Build()
     .Run();
 }
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseMassTransit()
     .Build()
     .Run();
 }
Beispiel #6
0
 public static void Main(string[] args)
 {
     ServiceHost.Create(new StructureMapContainerAdapter())
     .Logging(x => x.File("log.txt"))
     .ServiceFinder(x => x.ServicesInAssemblyOfType <Program>())
     .Run();
 }
 public async static Task MainAsync(string[] args)
 {
     await ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <ItemCreated2>()
     .Build()
     .Run();
 }
Beispiel #8
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <ActivityCreated>()
     .Build()
     .Run();
 }
 public static void Main(string[] args)
 {
     LoggerUtil.InitApp(ServiceHost.Create <Startup>(args).UseRabbitMq()
                        .SubscribeToEvent <PaymentAccepted>()
                        .SubscribeToEvent <PaymentRejected>()
                        .Build().Run);
     //new GrpcServer("localhost", 50051, Auditservice.AuditService.BindService(new AuditServiceImpl())).InitServer();
 }
Beispiel #10
0
        public static void Main(string[] args)
        {
            var builder = ServiceHost.Create <Startup>(args)
                          .UseRabbitMq()
                          .SubscribeToCommand <CreateAction>();

            builder.Build().Run();
        }
Beispiel #11
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseMessageBus()
     .AddAssemblySubscriptions()
     .Build()
     .Run();
 }
Beispiel #12
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToCommand <CreateActivity>()    // Subscribe service to commands.
     .Build()
     .Run();
 }
 public static void Main(string[] args)
 {
     // Default web host builder
     //BuildWebHost(args).Run();
     ServiceHost.Create <Startup>()
     .Build()
     .Run();
 }
Beispiel #14
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args, "http://*:5052")
     .UseRabbitMq()
     .SubscribeToCommand <CreateActivity>()
     .Build()
     .Run();
 }
Beispiel #15
0
 public static async Task Main(string[] args)
 {
     await ServiceHost.Create <Startup>(args)
     .UseRabbitMQ()
     .SubscribeToCommand <CreateActivity>()
     .Build()
     .Run();
 }
Beispiel #16
0
 public static async Task Main(string[] args)
 {
     await ServiceHost.Create <Startup>(args)
     .UseQueueImplementation <RabbitQueueMessageBus>()
     .SubscribeToCommand <CreateActivity>()
     .Build()
     .Run();
 }
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <DomainNotification>()
     .Build()
     .Run();
 }
Beispiel #18
0
 public static async Task Main(string[] args)
 {
     await ServiceHost.Create <Startup>(args)
     .UserRabbitMq()
     .SubscribeToEvent <ActivityCreated>()
     .Build()
     .RunAsync();
 }
Beispiel #19
0
 public static void Main(string[] args)
 {
     ServiceHost.Create<Startup>(args)
         .UseAutofac(Startup.LifetimeScope)
         .UseRabbitMq(queueName: typeof(Program).Namespace)
         .SubscribeToCommand<CreateUser>(exchangeName: "Frutinet.Services.Users", routingKey: "user.create")
         .Build()
         .Run();
 }
Beispiel #20
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .RegisterEvents()
     // .SubscribeToEvent<UserCreated>()
     .Build()
     .Run();
 }
 public static void Main(string[] args)
 {
     //service host responsible for consuming commands and producing events
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <ActivityCreated>()
     .Build()
     .Run();
 }
        /*
         *
         * public static void Main(string[] args)
         * {
         *  CreateHostBuilder(args).Build().Run();
         * }
         *
         * public static IHostBuilder CreateHostBuilder(string[] args) =>
         *  Host.CreateDefaultBuilder(args)
         *      .ConfigureWebHostDefaults(webBuilder =>
         *      {
         *          webBuilder.UseStartup<Startup>();
         *      });
         */

        #endregion

        public static void Main(string[] args)
        {
            ServiceHost
            .Create <Startup>(args)                             //returns service host
            .UseRabbitMq()                                      //return bus builder
            .SubscribeToCommand <TestMessagingCommand>()        //use ioc to create instance of the handler and tell the bus to handle the coommands with that hadker
            .Build()
            .Run();
        }
Beispiel #23
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubcribeToEvent <UserAuthenticated>()
     .SubcribeToEvent <UserCreated>()
     .Build()
     .Run();
 }
Beispiel #24
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <PaymentProcessed>()
     .SubscribeToEvent <PaymentFailed>()
     .Build()
     .Run();
 }
Beispiel #25
0
 public static void Main(string[] args)
 {
     //CreateHostBuilder(args).Build().Run();
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <ActivityCreated>()    // Subscribe API to events.
     .Build()
     .Run();
 }
Beispiel #26
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToCommand <ActivityCreated>()
     .Build()
     .Run();
     //CreateWebHostBuilder(args).Build().Run();
 }
Beispiel #27
0
        public static async Task Main(string[] args)
        {
            var serviceHost = ServiceHost.Create <Startup>(args)
                              .UseRabbitMq();

            await serviceHost.SubscribeToRcp <LoginRequest, LoginResponse>();

            serviceHost.Build().Run();
        }
Beispiel #28
0
 public static void Main(string[] args)
 {
     //CreateWebHostBuilder(args).Build().Run();
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToEvent <UsuarioCreatedEvent>()
     .Build()
     .Run();
 }
Beispiel #29
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     .SubscribeToCommand <ProcessPayment>()
     .SubscribeToEvent <UserCreated>()
     .Build()
     .Run();
 }
Beispiel #30
0
 public static void Main(string[] args)
 {
     ServiceHost.Create <Startup>(args)
     .UseRabbitMq()
     //.SubscribeToEvent<PushMessageCreated>()
     //.SubscribeToEvent<CreateActivityRejected>()
     .Build()
     .Run();
 }