Ejemplo n.º 1
0
 internal AtLeastOnceConsumingPromise(Queue queue,
                                      IConsumedMessageBuilder builder,
                                      ConsumingConfiguration configuration,
                                      Func<ILog> logBuilder)
     : base(queue, builder, configuration, logBuilder)
 {
 }
Ejemplo n.º 2
0
 internal AtMostOnceConsumer(IInboundChannel inboundChannel,
                             IOutboundChannel outboundChannel,
                             Queue queue,
                             IConsumedMessageBuilder builder,
                             ConsumingConfiguration configuration)
     : base(inboundChannel, outboundChannel, queue, builder, configuration)
 {
 }
Ejemplo n.º 3
0
 internal LoggedAtLeastOnceConsumer(IInboundChannel inboundChannel,
                                    IOutboundChannel outboundChannel,
                                    Queue queue,
                                    IConsumedMessageBuilder builder,
                                    ConsumingConfiguration configuration,
                                    ILog log)
     : base(inboundChannel, outboundChannel, queue, builder, configuration)
 {
     _log = log;
 }
Ejemplo n.º 4
0
 protected internal ConsumingPromise(Queue queue,
                                     IConsumedMessageBuilder builder,
                                     ConsumingConfiguration configuration,
                                     Func<ILog> logBuilder)
 {
     Queue = queue;
     Builder = builder;
     Configuration = configuration;
     LogBuilder = logBuilder;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 8
0
 private Queue DeclareQueue(String name, Boolean isDurable)
 {
     var queue = new Queue(name, isDurable);
     _queues.Add(queue);
     return queue;
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 10
0
 public void SubscribeByAtMostOnce(Queue queue, Action<ConsumingConfiguration> configure)
 {
     Subscribe(configure,
               (b, c) => new AtMostOnceConsumingPromise(queue, b, c, () => _configuration.Log),
               queue);
 }
Ejemplo n.º 11
0
 public Boolean Equals(Queue other)
 {
     return String.Equals(Name, other.Name);
 }