예제 #1
0
 public RabbitMqListeningAgent(Uri address, ITransportLogger logger, IEnvelopeMapper mapper,
                               RabbitMqAgent agent)
 {
     _logger = logger;
     _mapper = mapper;
     _agent  = agent;
     Address = address;
     _queue  = agent.QueueName;
 }
예제 #2
0
        public RabbitMqSender(ITransportLogger logger, RabbitMqAgent agent,
                              CancellationToken cancellation)
        {
            _mapper       = agent.EnvelopeMapping;
            _logger       = logger;
            _agent        = agent;
            _cancellation = cancellation;
            Destination   = agent.Uri;

            _address = agent.PublicationAddress();
        }
예제 #3
0
        public RabbitMqAgent For(Uri uri)
        {
            if (_connectionFactories.ContainsKey(uri))
            {
                return(_connectionFactories[uri]);
            }

            lock (_locker)
            {
                if (_connectionFactories.ContainsKey(uri))
                {
                    return(_connectionFactories[uri]);
                }


                var agent = new RabbitMqAgent(uri);

                _connectionFactories[uri] = agent;

                return(agent);
            }
        }
예제 #4
0
 public RabbitMQListeningAgent(Uri address, ITransportLogger logger, IModel channel, IEnvelopeMapper mapper, RabbitMqAgent agent)
 {
     _logger  = logger;
     _channel = channel;
     _mapper  = mapper;
     Address  = address;
     _queue   = agent.QueueName;
 }