Source:
public void start() throws AmqpException { if (logger.isDebugEnabled()) { logger.debug("Starting consumer " + this); } try { this.channel = ConnectionFactoryUtils.getTransactionalResourceHolder(connectionFactory, transactional) .getChannel(); } catch (AmqpAuthenticationException e) { throw new FatalListenerStartupException("Authentication failure", e); } this.consumer = new InternalConsumer(channel); this.deliveryTags.clear(); this.activeObjectCounter.add(this); int passiveDeclareTries = 3; do { try { if (!acknowledgeMode.isAutoAck()) { channel.basicQos(prefetchCount); } for (int i = 0; i < queues.length; i++) { channel.queueDeclarePassive(queues[i]); } passiveDeclareTries = 0; } catch (IOException e) { if (passiveDeclareTries > 0 && channel.isOpen()) { if (logger.isWarnEnabled()) { logger.warn("Reconnect failed; retries left=" + (passiveDeclareTries-1), e); try { Thread.sleep(5000); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } } } else { this.activeObjectCounter.release(this); throw new FatalListenerStartupException("Cannot prepare queue for listener. " + "Either the queue doesn't exist or the broker will not allow us to use it.", e); } } } while (passiveDeclareTries-- > 0); try { for (int i = 0; i < queues.length; i++) { if (this.consumerArgs.size() > 0) { channel.basicConsume(this.queues[i], this.acknowledgeMode.isAutoAck(), UUID.randomUUID().toString(), false, false, this.consumerArgs, this.consumer); } else { channel.basicConsume(this.queues[i], this.acknowledgeMode.isAutoAck(), consumer); } if (logger.isDebugEnabled()) { logger.debug("Started on queue '" + queues[i] + "': " + this); } } } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }

Target:
public void start() throws AmqpException { if (logger.isDebugEnabled()) { logger.debug("Starting consumer " + this); } try { this.channel = ConnectionFactoryUtils.getTransactionalResourceHolder(connectionFactory, transactional) .getChannel(); } catch (AmqpAuthenticationException e) { throw new FatalListenerStartupException("Authentication failure", e); } this.consumer = new InternalConsumer(channel); this.deliveryTags.clear(); this.activeObjectCounter.add(this); int passiveDeclareTries = 3; do { try { if (!acknowledgeMode.isAutoAck()) { channel.basicQos(prefetchCount); } for (int i = 0; i < queues.length; i++) { channel.queueDeclarePassive(queues[i]); } passiveDeclareTries = 0; } catch (IOException e) { if (passiveDeclareTries > 0 && channel.isOpen()) { if (logger.isWarnEnabled()) { logger.warn("Reconnect failed; retries left=" + (passiveDeclareTries-1), e); try { Thread.sleep(5000); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } } } else { this.activeObjectCounter.release(this); throw new FatalListenerStartupException("Cannot prepare queue for listener. " + "Either the queue doesn't exist or the broker will not allow us to use it.", e); } } } while (passiveDeclareTries-- > 0); try { for (int i = 0; i < queues.length; i++) { if (this.consumerArgs.size() > 0) { channel.basicConsume(this.queues[i], this.acknowledgeMode.isAutoAck(), "", false, false, this.consumerArgs, this.consumer); } else { channel.basicConsume(this.queues[i], this.acknowledgeMode.isAutoAck(), consumer); } if (logger.isDebugEnabled()) { logger.debug("Started on queue '" + queues[i] + "': " + this); } } } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }