public MassTransitEndpointListener(IExtendedHost extendedHost, TConsumer consumer, string queueName, Action <IReceiveEndpointConfigurator> configure = null, bool autoDelete = true) { _extendedHost = extendedHost; _consumer = consumer; _queueName = queueName; _configure = configure; _autoDelete = autoDelete; }
public async Task StopBus() { if (Host != null) { await Host.DisconnectAllEndpoints(); } if (Bus != null) { await Bus.StopAsync(); } Host = null; Bus = null; }
public static BusHost CreateUsingRabbitMq(RabbitMqBusSettings rabbitMqSettings, Action <IRabbitMqBusFactoryConfigurator> configure = null) { IExtendedHost host = null; var busControl = Bus.Factory.CreateUsingRabbitMq(cfg => { var rabbitMqHost = cfg.Host(new Uri(rabbitMqSettings.Host), h => { h.Username(rabbitMqSettings.Username); h.Password(rabbitMqSettings.Password); }); host = new RabbitMqExtendedHostProvider(rabbitMqHost); cfg.UseNLog(new LogFactory()); configure?.Invoke(cfg); }); var busHost = new BusHost(busControl, host); return(busHost); }
public BusHost(IBusControl bus, IExtendedHost host = null) { Bus = bus; Host = host; }