Beispiel #1
0
        public static SimpleEsbBuilder UseMongoDb(this SimpleEsbBuilder builder, string server, string database)
        {
            builder.Services.AddSingleton <MongoOptions>(p => new MongoOptions {
                Host = server, Database = database
            });
            builder.Services.AddSingleton <IDataStore, MongoDoHickey>();

            return(builder);
        }
Beispiel #2
0
        public static SimpleEsbBuilder UseRabbitMq(this SimpleEsbBuilder builder, string server, string exchange = "default")
        {
            builder.Services.AddSingleton <IServiceBus, RabbitServiceBus>();
            builder.Services.AddSingleton <RabbitMqOptions, RabbitMqOptions>(x => new RabbitMqOptions {
                Server = server, Exchange = exchange
            });
            builder.Services.AddSingleton <IStartupSegment, Server>();
            builder.Services.AddSingleton <RabbitClient>();

            return(builder);
        }