public void EnsureChannelAvailable() { if (_disposed) { _channel = null; return; } if (_channel?.IsOpen != true) { Logger.LogDebug("Creating a model."); _channel = _connectionProvider.Connection.CreateModel(); ModelCreated?.Invoke(this, new ModelCreatedEventArgs(_channel)); _channel.BasicAcks += (channel, args) => BasicAcks?.Invoke(channel, args); _channel.BasicNacks += (channel, args) => BasicNacks?.Invoke(channel, args); _channel.ConfirmSelect(); // manual (N)ACK Logger.LogDebug("Model created."); } }
private void Model_BasicNacks(object sender, BasicNackEventArgs e) { BasicNacks?.Invoke(sender, e); }