public void start() throws AmqpException { if (logger.isDebugEnabled()) { logger.debug("Starting consumer " + this); } this.thread = Thread.currentThread(); try { this.resourceHolder = ConnectionFactoryUtils.getTransactionalResourceHolder(this.connectionFactory, this.transactional); this.channel = this.resourceHolder.getChannel(); ClosingRecoveryListener.addRecoveryListenerIfNecessary(this.channel); // NOSONAR never null here } catch (AmqpAuthenticationException e) { throw new FatalListenerStartupException("Authentication failure", e); } this.deliveryTags.clear(); this.activeObjectCounter.add(this); passiveDeclarations(); setQosAndreateConsumers(); }
public void start() throws AmqpException { if (logger.isDebugEnabled()) { logger.debug("Starting consumer " + this); } this.thread = Thread.currentThread(); try { this.resourceHolder = ConnectionFactoryUtils.getTransactionalResourceHolder(this.connectionFactory, this.transactional); this.channel = this.resourceHolder.getChannel(); ClosingRecoveryListener.addRecoveryListenerIfNecessary(this.channel); // NOSONAR never null here } catch (AmqpAuthenticationException e) { throw new FatalListenerStartupException("Authentication failure", e); } this.deliveryTags.clear(); this.activeObjectCounter.add(this); passiveDeclarations(); setQosAndreateConsumers(); }
protected void checkMismatchedQueues() { if (this.mismatchedQueuesFatal && this.amqpAdmin != null) { try { this.amqpAdmin.initialize(); } catch (AmqpConnectException e) { logger.info("Broker not available; cannot check queue declarations"); } catch (AmqpIOException e) { if (RabbitUtils.isMismatchedQueueArgs(e)) { throw new FatalListenerStartupException("Mismatched queues", e); } else { logger.info("Failed to get connection during start(): " + e); } } } else { try { Connection connection = getConnectionFactory().createConnection(); // NOSONAR if (connection != null) { connection.close(); } } catch (Exception e) { logger.info("Broker not available; cannot force queue declarations during start"); } } }
protected void checkMismatchedQueues() { if (this.mismatchedQueuesFatal && this.amqpAdmin != null) { try { this.amqpAdmin.initialize(); } catch (AmqpConnectException e) { logger.info("Broker not available; cannot check queue declarations"); } catch (AmqpIOException e) { if (RabbitUtils.isMismatchedQueueArgs(e)) { throw new FatalListenerStartupException("Mismatched queues", e); } else { logger.info("Failed to get connection during start(): " + e); } } } else { try { Connection connection = getConnectionFactory().createConnection(); // NOSONAR if (connection != null) { connection.close(); } } catch (Exception e) { logger.info("Broker not available; cannot force queue declarations during start"); } } }
throw new FatalListenerStartupException("Mismatched queues", e);
throw new FatalListenerStartupException("Mismatched queues", e);
throw new FatalListenerStartupException("Illegal Argument on Queue Declaration", e);
throw new FatalListenerStartupException("Illegal Argument on Queue Declaration", e);
if (isPossibleAuthenticationFailureFatal()) { this.startupException = new FatalListenerStartupException("Authentication failure", new AmqpAuthenticationException(ex));
if (isPossibleAuthenticationFailureFatal()) { this.startupException = new FatalListenerStartupException("Authentication failure", new AmqpAuthenticationException(ex));