public EventBus(ILifetimeScope scope, IOptions <BrokerOptions> options) { Scope = scope; BrokerOptions = options; Factory = BrokerMessageConnectionFactory.CreateConnection(BrokerOptions.Value); Connection = Factory.CreateConnection(); Channel = Connection.CreateModel(); }
public EventBus(IComponentContext context, IOptions <BrokerOptions> options, Action <ContainerBuilder, IConfiguration> configureScope) { Context = context; BrokerOptions = options; Factory = BrokerMessageConnectionFactory.CreateConnection(BrokerOptions.Value); Connection = Factory.CreateConnection(); Channel = Connection.CreateModel(); ConfigureScope = configureScope; }
protected virtual void Init() { Factory = BrokerMessageConnectionFactory.CreateConnection(BrokerOptions); if (!string.IsNullOrEmpty(BrokerOptions.UserName)) { Factory.UserName = BrokerOptions.UserName; } if (!string.IsNullOrEmpty(BrokerOptions.Password)) { Factory.Password = BrokerOptions.Password; } Connection = Factory.CreateConnection(); Channel = Connection.CreateModel(); }