我在 eshop 订单篮项目中工作。我需要帮助解决此代码中的rabbitmq错误:
using Microsoft.Extensions.Logging;
using Polly;
using Polly.Retry;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using RabbitMQ.Client.Exceptions;
using System;
using System.IO;
using System.Net.Sockets;
namespace InfiniteWorx.MRU.BuildingBlocks.EventBusRabbitMQ
{
public class DefaultRabbitMQPersistentConnection
: IRabbitMQPersistentConnection
{
private readonly IConnectionFactory _connectionFactory;
private readonly ILogger<DefaultRabbitMQPersistentConnection> _logger;
private readonly int _retryCount;
IConnection _connection;
bool _disposed;
object sync_root = new object();
public DefaultRabbitMQPersistentConnection(IConnectionFactory
connectionFactory, ILogger<DefaultRabbitMQPersistentConnection> logger, int
retryCount = 5)
{
_connectionFactory = connectionFactory ?? throw new
ArgumentNullException(nameof(connectionFactory));
_logger = logger ?? throw new
ArgumentNullException(nameof(logger));
_retryCount = retryCount;
}
public …
Run Code Online (Sandbox Code Playgroud)