private void cancelConsumer(SimpleConsumer consumer) { try { if (this.logger.isDebugEnabled()) { this.logger.debug("Canceling " + consumer); } synchronized (consumer) { consumer.canceled = true; if (this.messagesPerAck > 1) { consumer.ackIfNecessary(0L); } } consumer.getChannel().basicCancel(consumer.getConsumerTag()); } catch (IOException e) { this.logger.error("Failed to cancel consumer: " + consumer, e); } finally { this.consumers.remove(consumer); consumerRemoved(consumer); } }
private void cancelConsumer(SimpleConsumer consumer) { try { if (this.logger.isDebugEnabled()) { this.logger.debug("Canceling " + consumer); } synchronized (consumer) { consumer.canceled = true; if (this.messagesPerAck > 1) { consumer.ackIfNecessary(0L); } } consumer.getChannel().basicCancel(consumer.getConsumerTag()); } catch (IOException e) { this.logger.error("Failed to cancel consumer: " + consumer, e); } finally { this.consumers.remove(consumer); consumerRemoved(consumer); } }
private void finalizeConsumer() { RabbitUtils.setPhysicalCloseRequired(getChannel(), true); RabbitUtils.closeChannel(getChannel()); RabbitUtils.closeConnection(this.connection); DirectMessageListenerContainer.this.cancellationLock.release(this); consumerRemoved(this); }
private void finalizeConsumer() { RabbitUtils.setPhysicalCloseRequired(getChannel(), true); RabbitUtils.closeChannel(getChannel()); RabbitUtils.closeConnection(this.connection); DirectMessageListenerContainer.this.cancellationLock.release(this); consumerRemoved(this); }