Пример #1
0
        async Task <ActiveMqBasicConsumer> CreateConsumer(SessionContext context, string entityName, string selector)
        {
            var queue = await context.GetQueue(entityName).ConfigureAwait(false);

            var messageConsumer = await context.CreateMessageConsumer(queue, selector, false).ConfigureAwait(false);

            var consumer = new ActiveMqBasicConsumer(context, messageConsumer, _context.InputAddress, _context);

            await consumer.Ready.ConfigureAwait(false);

            return(consumer);
        }
Пример #2
0
        async Task <ActiveMqBasicConsumer> CreateConsumer(SessionContext context, Uri inputAddress, string entityName, string selector)
        {
            var queue = await context.GetQueue(entityName).ConfigureAwait(false);

            var messageConsumer = await context.CreateMessageConsumer(queue, selector, false).ConfigureAwait(false);

            var consumer = new ActiveMqBasicConsumer(context, messageConsumer, inputAddress, _receivePipe, _receiveObserver, _context, _deadLetterTransport,
                                                     _errorTransport);

            await consumer.Ready.ConfigureAwait(false);

            return(consumer);
        }
Пример #3
0
        async Task <ActiveMqBasicConsumer> CreateConsumer(SessionContext context, string entityName, string selector, ushort prefetchCount)
        {
            string queueName = $"{entityName}?consumer.prefetchSize={prefetchCount}";

            var queue = await context.GetQueue(queueName).ConfigureAwait(false);

            var messageConsumer = await context.CreateMessageConsumer(queue, selector, false).ConfigureAwait(false);

            LogContext.Debug?.Log("Created consumer for {InputAddress}: {Queue}", _context.InputAddress, queueName);

            var consumer = new ActiveMqBasicConsumer(context, messageConsumer, _context.InputAddress, _context);

            await consumer.Ready.ConfigureAwait(false);

            return(consumer);
        }