Beispiel #1
0
 internal AtLeastOnceConsumingPromise(Queue queue,
                                      IConsumedMessageBuilder builder,
                                      ConsumingConfiguration configuration,
                                      Func<ILog> logBuilder)
     : base(queue, builder, configuration, logBuilder)
 {
 }
Beispiel #2
0
 internal AtMostOnceConsumer(IInboundChannel inboundChannel,
                             IOutboundChannel outboundChannel,
                             Queue queue,
                             IConsumedMessageBuilder builder,
                             ConsumingConfiguration configuration)
     : base(inboundChannel, outboundChannel, queue, builder, configuration)
 {
 }
 internal LoggedAtLeastOnceConsumer(IInboundChannel inboundChannel,
                                    IOutboundChannel outboundChannel,
                                    Queue queue,
                                    IConsumedMessageBuilder builder,
                                    ConsumingConfiguration configuration,
                                    ILog log)
     : base(inboundChannel, outboundChannel, queue, builder, configuration)
 {
     _log = log;
 }
Beispiel #4
0
 protected internal ConsumingPromise(Queue queue,
                                     IConsumedMessageBuilder builder,
                                     ConsumingConfiguration configuration,
                                     Func<ILog> logBuilder)
 {
     Queue = queue;
     Builder = builder;
     Configuration = configuration;
     LogBuilder = logBuilder;
 }
Beispiel #5
0
        protected internal ConsumerBase(IInboundChannel inboundChannel,
                                        IOutboundChannel outboundChannel,
                                        Queue queue,
                                        IConsumedMessageBuilder builder,
                                        ConsumingConfiguration configuration)
        {
            InboundChannel = inboundChannel;
            OutboundChannel = outboundChannel;
            _queue = queue;
            _builder = builder;
            Configuration = configuration;

            ConsumerCancelled += OnConsumerCancelled;
        }
Beispiel #6
0
        public void DeclareExchangeBinding(Exchange exchange, Queue queue, String routingKey = "")
        {
            if (exchange == null)
                throw new ArgumentNullException(nameof(exchange));

            if (queue == null)
                throw new ArgumentNullException(nameof(queue));

            if (routingKey == null)
                throw new ArgumentNullException(nameof(routingKey));

            if (!_bindings.Add(new ExchangeBinding(exchange, queue, routingKey)))
                throw new ArgumentException("dupicate binding detected");
        }
Beispiel #7
0
 private void Subscribe(Action<ConsumingConfiguration> configure,
                        Func<IConsumedMessageBuilder, ConsumingConfiguration, ConsumingPromise> func,
                        Queue queue)
 {
     var configuration = new ConsumingConfiguration(this, queue);
     configure(configuration);
     Func<IConsumedMessageBuilder, ConsumingPromise> f = _ => func(_, configuration);
     _promises.Add(f);
 }
Beispiel #8
0
 private Queue DeclareQueue(String name, Boolean isDurable)
 {
     var queue = new Queue(name, isDurable);
     _queues.Add(queue);
     return queue;
 }
Beispiel #9
0
        public Boolean TryDeclareExchangeBinding(Exchange exchange, Queue queue, String routingKey = "")
        {
            if (queue == null)
                throw new ArgumentNullException(nameof(queue));

            if (routingKey == null)
                throw new ArgumentNullException(nameof(routingKey));

            return _bindings.Add(new ExchangeBinding(exchange, queue, routingKey));
        }
Beispiel #10
0
 public void SubscribeByAtMostOnce(Queue queue, Action<ConsumingConfiguration> configure)
 {
     Subscribe(configure,
               (b, c) => new AtMostOnceConsumingPromise(queue, b, c, () => _configuration.Log),
               queue);
 }
Beispiel #11
0
 public Boolean Equals(Queue other)
 {
     return String.Equals(Name, other.Name);
 }