コード例 #1
0
        public RabbitMQReader(RabbitMQReaderSetup setup, bool cloneSetup)
        {
            MethodInvocationTrace.Write();
            _setup = cloneSetup ? setup.Clone() : setup;
            _invocationTracker = new ConcurrentOperationManager(GetType().FullName);
            _conn = RabbitMQReaderConnection.Create(_setup, false);
            _deleteQueue = !_setup.IsDurable;

            _throttler = (_setup.Options == null)
                ? NoOpDequeueThrottler.Instance
                : _setup.Options.DequeueThrottlerFactory.Create(_setup.Exchange, _setup.QueueName);
        }
コード例 #2
0
 public IRabbitMQReader CreateReader(RabbitMQReaderSetup setup)
 {
     setup = setup.Clone();
     RabbitMQReader reader = null;
     try
     {
         reader = new RabbitMQReader(setup, false);
         reader.EnsureOpen(setup.Timeout, setup.CancelToken);
         return reader;
     }
     catch
     {
         DisposeHelper.DisposeIfNotNull(reader);
         throw;
     }
 }
コード例 #3
0
 public static RabbitMQReaderConnection Create(RabbitMQReaderSetup setup, bool cloneSetup)
 {
     return new RabbitMQReaderConnection(cloneSetup ? setup.Clone() : setup);
 }