/// <summary> /// Configures Rebus to use RabbitMQ to move messages around /// </summary> public static RabbitMqOptionsBuilder UseRabbitMq(this StandardConfigurer<ITransport> configurer, string connectionString, string inputQueueName) { var options = new RabbitMqOptionsBuilder(); configurer .OtherService<RabbitMqTransport>() .Register(c => { var transport = new RabbitMqTransport(connectionString, inputQueueName); if (options.NumberOfMessagesToprefetch.HasValue) { transport.SetPrefetching(options.NumberOfMessagesToprefetch.Value); } return transport; }); configurer .OtherService<ISubscriptionStorage>() .Register(c => c.Get<RabbitMqTransport>(), description: RabbitMqSubText); configurer.Register(c => c.Get<RabbitMqTransport>()); return options; }
/// <summary> /// Configures Rebus to use RabbitMQ to move messages around /// </summary> public static RabbitMqOptionsBuilder UseRabbitMq(this StandardConfigurer <ITransport> configurer, string connectionString, string inputQueueName) { var options = new RabbitMqOptionsBuilder(); configurer .OtherService <RabbitMqTransport>() .Register(c => { var rebusLoggerFactory = c.Get <IRebusLoggerFactory>(); var transport = new RabbitMqTransport(connectionString, inputQueueName, rebusLoggerFactory); if (options.NumberOfMessagesToprefetch.HasValue) { transport.SetPrefetching(options.NumberOfMessagesToprefetch.Value); } return(transport); }); configurer .OtherService <ISubscriptionStorage>() .Register(c => c.Get <RabbitMqTransport>(), description: RabbitMqSubText); configurer.Register(c => c.Get <RabbitMqTransport>()); return(options); }
/// <summary> /// Configures Rebus to use RabbitMQ to move messages around /// </summary> public static RabbitMqOptionsBuilder UseRabbitMq(this StandardConfigurer<ITransport> configurer, string connectionString, string inputQueueName) { var options = new RabbitMqOptionsBuilder(); configurer .OtherService<RabbitMqTransport>() .Register(c => { var rebusLoggerFactory = c.Get<IRebusLoggerFactory>(); var transport = new RabbitMqTransport(connectionString, inputQueueName, rebusLoggerFactory); options.Configure(transport); return transport; }); configurer .OtherService<ISubscriptionStorage>() .Register(c => c.Get<RabbitMqTransport>(), description: RabbitMqSubText); configurer.Register(c => c.Get<RabbitMqTransport>()); return options; }
/// <summary> /// Configures Rebus to use RabbitMQ to transport messages as a one-way client (i.e. will not be able to receive any messages) /// </summary> public static RabbitMqOptionsBuilder UseRabbitMqAsOneWayClient(this StandardConfigurer<ITransport> configurer, string connectionString) { var options = new RabbitMqOptionsBuilder(); configurer .OtherService<RabbitMqTransport>() .Register(c => { var rebusLoggerFactory = c.Get<IRebusLoggerFactory>(); var transport = new RabbitMqTransport(connectionString, null, rebusLoggerFactory); options.Configure(transport); return transport; }); configurer .OtherService<ISubscriptionStorage>() .Register(c => c.Get<RabbitMqTransport>(), description: RabbitMqSubText); configurer.Register(c => c.Get<RabbitMqTransport>()); OneWayClientBackdoor.ConfigureOneWayClient(configurer); return options; }
/// <summary> /// Configures Rebus to use RabbitMQ to transport messages as a one-way client (i.e. will not be able to receive any messages) /// </summary> public static RabbitMqOptionsBuilder UseRabbitMqAsOneWayClient(this StandardConfigurer <ITransport> configurer, string connectionString) { var options = new RabbitMqOptionsBuilder(); configurer .OtherService <RabbitMqTransport>() .Register(c => { var rebusLoggerFactory = c.Get <IRebusLoggerFactory>(); var transport = new RabbitMqTransport(connectionString, null, rebusLoggerFactory); options.Configure(transport); return(transport); }); configurer .OtherService <ISubscriptionStorage>() .Register(c => c.Get <RabbitMqTransport>(), description: RabbitMqSubText); configurer.Register(c => c.Get <RabbitMqTransport>()); OneWayClientBackdoor.ConfigureOneWayClient(configurer); return(options); }