Skip to content
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageVersion Include="NEST" Version="7.17.5" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="RabbitMQ.Client" Version="6.8.1" />
<PackageVersion Include="RabbitMQ.Client" Version="7.0.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.5.0.109200" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.24" />
<PackageVersion Include="StackExchange.Redis.Extensions.Core" Version="9.1.0" />
Expand All @@ -33,4 +33,4 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
</ItemGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions Src/CrispyWaffle.RabbitMQ/Log/RabbitMQLogProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/// <summary>
/// The channel.
/// </summary>
private readonly IModel _channel;
private readonly IChannel _channel;

/// <summary>
/// The cancellation token.
Expand All @@ -55,8 +55,8 @@
public RabbitMQLogProvider(RabbitMQConnector connector, CancellationToken cancellationToken)
{
_connector = connector ?? throw new ArgumentNullException(nameof(connector));
_channel = _connector.ConnectionFactory.CreateConnection().CreateModel();
_channel.ExchangeDeclare(_connector.DefaultExchangeName, ExchangeType.Fanout, true);
_channel = _connector.ConnectionFactory.CreateConnectionAsync().GetAwaiter().GetResult().CreateModelAsync().GetAwaiter().GetResult();

Check failure on line 58 in Src/CrispyWaffle.RabbitMQ/Log/RabbitMQLogProvider.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'IConnection' does not contain a definition for 'CreateModelAsync' and no accessible extension method 'CreateModelAsync' accepting a first argument of type 'IConnection' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 58 in Src/CrispyWaffle.RabbitMQ/Log/RabbitMQLogProvider.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'IConnection' does not contain a definition for 'CreateModelAsync' and no accessible extension method 'CreateModelAsync' accepting a first argument of type 'IConnection' could be found (are you missing a using directive or an assembly reference?)
_channel.ExchangeDeclareAsync(_connector.DefaultExchangeName, ExchangeType.Fanout, true).GetAwaiter().GetResult();
_cancellationToken = cancellationToken;
_queue = new ConcurrentQueue<string>();
var thread = new Thread(Worker);
Expand Down Expand Up @@ -107,7 +107,7 @@
try
{
var body = Encoding.UTF8.GetBytes(message);
_channel.BasicPublish(_connector.DefaultExchangeName, string.Empty, null, body);

Check failure on line 110 in Src/CrispyWaffle.RabbitMQ/Log/RabbitMQLogProvider.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'IChannel' does not contain a definition for 'BasicPublish' and no accessible extension method 'BasicPublish' accepting a first argument of type 'IChannel' could be found (are you missing a using directive or an assembly reference?)
}
catch (Exception e)
{
Expand All @@ -126,7 +126,7 @@
return;
}

_channel.Close();

Check failure on line 129 in Src/CrispyWaffle.RabbitMQ/Log/RabbitMQLogProvider.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'IChannel' does not contain a definition for 'Close' and no accessible extension method 'Close' accepting a first argument of type 'IChannel' could be found (are you missing a using directive or an assembly reference?)
}

/// <summary>
Expand Down
Loading