Exemplo n.º 1
0
        public IDisposable StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => Dispose();

            var status = internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage,
                configuration
                );

            if (status == StartConsumingStatus.Succeed)
            {
                eventBus.Publish(new StartConsumingSucceededEvent(this, queue));
            }
            else
            {
                eventBus.Publish(new StartConsumingFailedEvent(this, queue));
            }

            consumerCancellation = new ConsumerCancellation(Dispose);
            return(consumerCancellation);
        }
Exemplo n.º 2
0
        public void StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => OnRemoveMeFromList();

            internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage);
        }
Exemplo n.º 3
0
        public void StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => OnRemoveMeFromList();

            internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage);
        }
Exemplo n.º 4
0
        public IDisposable StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => Dispose();

            internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage);

            return(new ConsumerCancellation(Dispose));
        }
Exemplo n.º 5
0
        public IDisposable StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => Dispose();

            internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage);

            return new ConsumerCancellation(Dispose);
        }
Exemplo n.º 6
0
        public void StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => OnRemoveMeFromList();

            internalConsumer.AckOrNackWasSent += context =>
                {
                    OnRemoveMeFromList();
                    Dispose();
                };

            internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage);
        }
Exemplo n.º 7
0
        public void StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => OnRemoveMeFromList();

            internalConsumer.AckOrNackWasSent += context =>
            {
                OnRemoveMeFromList();
                Dispose();
            };

            internalConsumer.StartConsuming(
                connection,
                queue,
                onMessage);
        }
Exemplo n.º 8
0
        /// <inheritdoc />
        public void StartConsuming()
        {
            internalConsumer = internalConsumerFactory.CreateConsumer();

            internalConsumer.Cancelled += consumer => Dispose();

            var status = internalConsumer.StartConsuming(
                queue,
                onMessage,
                configuration
                );

            if (status == StartConsumingStatus.Succeed)
            {
                eventBus.Publish(new StartConsumingSucceededEvent(this, queue));
            }
            else
            {
                eventBus.Publish(new StartConsumingFailedEvent(this, queue));
            }
        }