private void passiveDeclarations() { // mirrored queue might be being moved int passiveDeclareRetries = this.declarationRetries; this.declaring = true; do { if (cancelled()) { break; } try { attemptPassiveDeclarations(); if (passiveDeclareRetries < this.declarationRetries && logger.isInfoEnabled()) { logger.info("Queue declaration succeeded after retrying"); } passiveDeclareRetries = 0; } catch (DeclarationException e) { handleDeclarationException(passiveDeclareRetries, e); } } while (passiveDeclareRetries-- > 0 && !cancelled()); this.declaring = false; }
private void passiveDeclarations() { // mirrored queue might be being moved int passiveDeclareRetries = this.declarationRetries; this.declaring = true; do { if (cancelled()) { break; } try { attemptPassiveDeclarations(); if (passiveDeclareRetries < this.declarationRetries && logger.isInfoEnabled()) { logger.info("Queue declaration succeeded after retrying"); } passiveDeclareRetries = 0; } catch (DeclarationException e) { handleDeclarationException(passiveDeclareRetries, e); } } while (passiveDeclareRetries-- > 0 && !cancelled()); this.declaring = false; }
public synchronized void stop() { if (this.abortStarted == 0) { // signal handle delivery to use offer this.abortStarted = System.currentTimeMillis(); } if (!this.cancelled()) { try { RabbitUtils.closeMessageConsumer(this.channel, getConsumerTags(), this.transactional); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Error closing consumer " + this, e); } } } if (logger.isDebugEnabled()) { logger.debug("Closing Rabbit Channel: " + this.channel); } RabbitUtils.setPhysicalCloseRequired(this.channel, true); ConnectionFactoryUtils.releaseResources(this.resourceHolder); this.deliveryTags.clear(); this.consumers.clear(); this.queue.clear(); // in case we still have a client thread blocked }
public synchronized void stop() { if (this.abortStarted == 0) { // signal handle delivery to use offer this.abortStarted = System.currentTimeMillis(); } if (!this.cancelled()) { try { RabbitUtils.closeMessageConsumer(this.channel, getConsumerTags(), this.transactional); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Error closing consumer " + this, e); } } } if (logger.isDebugEnabled()) { logger.debug("Closing Rabbit Channel: " + this.channel); } RabbitUtils.setPhysicalCloseRequired(this.channel, true); ConnectionFactoryUtils.releaseResources(this.resourceHolder); this.deliveryTags.clear(); this.consumers.clear(); this.queue.clear(); // in case we still have a client thread blocked }
private void setQosAndreateConsumers() { if (!this.acknowledgeMode.isAutoAck() && !cancelled()) { // Set basicQos before calling basicConsume (otherwise if we are not acking the broker // will send blocks of 100 messages) try { this.channel.basicQos(this.prefetchCount); } catch (IOException e) { this.activeObjectCounter.release(this); throw new AmqpIOException(e); } } try { if (!cancelled()) { for (String queueName : this.queues) { if (!this.missingQueues.contains(queueName)) { consumeFromQueue(queueName); } } } } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }
private void setQosAndreateConsumers() { if (!this.acknowledgeMode.isAutoAck() && !cancelled()) { // Set basicQos before calling basicConsume (otherwise if we are not acking the broker // will send blocks of 100 messages) try { this.channel.basicQos(this.prefetchCount); } catch (IOException e) { this.activeObjectCounter.release(this); throw new AmqpIOException(e); } } try { if (!cancelled()) { for (String queueName : this.queues) { if (!this.missingQueues.contains(queueName)) { consumeFromQueue(queueName); } } } } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }
while (isActive(this.consumer) || this.consumer.hasDelivery() || !this.consumer.cancelled()) { mainLoop();
while (isActive(this.consumer) || this.consumer.hasDelivery() || !this.consumer.cancelled()) { mainLoop();