public AmqpDestination(ArgumentsModel model, ILogger <AmqpDestination> logger)
        {
            _model  = model;
            _logger = logger;

            Uri amqpUri = new Uri(model.Output);

            _logger.LogDebug("Connecting to AMQP for writing at {Uri}", amqpUri);

            UriConnectionFactory connectionFactory = new UriConnectionFactory(amqpUri);

            _connection = connectionFactory.CreateConnection();
            _channel    = _connection.CreateModel();
        }
Example #2
0
        public AmqpSource(ArgumentsModel model, ILogger <AmqpSource> logger)
        {
            _model     = model;
            _logger    = logger;
            _remaining = model.MessageLimit ?? -1;

            Uri amqpUri = new Uri(model.Input);

            _logger.LogDebug("Connecting to AMQP for reading at {Uri}", amqpUri);

            UriConnectionFactory connectionFactory = new UriConnectionFactory(amqpUri);

            _connection = connectionFactory.CreateConnection();
            _channel    = _connection.CreateModel();
        }