Beispiel #1
0
        public static IBusService UsingEventHubs(this IBusServiceFactoryExtensionHook extensionHook,
                                                 Action <IEventHubsBusServiceConfiguration> action)
        {
            IEventHubsBusServiceConfiguration configuration = new EventHubsBusServiceConfiguration();

            action(configuration);

            return(new EventHubsBusService(configuration));
        }
        public static IBusService UsingInMemory(this IBusServiceFactoryExtensionHook extensionHook,
                                                Action <IInMemoryBusServiceConfiguration> action)
        {
            IInMemoryBusServiceConfiguration configuration = new InMemoryBusServiceConfiguration();

            action(configuration);

            return(new InMemoryBusService(configuration));
        }
        public static IBusService UsingRabbitMq(this IBusServiceFactoryExtensionHook extensionHook,
                                                Action <IRabbitMqBusServiceConfiguration> action)
        {
            IRabbitMqBusServiceConfiguration configuration = new RabbitMqBusServiceConfiguration();

            action(configuration);

            IRabbitMqHost host = null;
            var           bus  = Bus.Factory.CreateUsingRabbitMq(cfg =>
            {
                host = cfg.Host(new Uri(configuration.Uri), h =>
                {
                    h.Username(configuration.Username);
                    h.Password(configuration.Password);
                });
            });

            return(new RabbitMqBusService(bus, host));
        }