private void rollback(long deliveryTag, Exception e) { if (isChannelTransacted()) { RabbitUtils.rollbackIfNecessary(getChannel()); } if (this.ackRequired) { try { if (this.messagesPerAck > 1) { synchronized (this) { if (this.pendingAcks > 0) { sendAck(System.currentTimeMillis()); } } } getChannel().basicNack(deliveryTag, true, ContainerUtils.shouldRequeue(isDefaultRequeueRejected(), e, this.logger)); } catch (IOException e1) { this.logger.error("Failed to nack message", e1); } } if (isChannelTransacted()) { RabbitUtils.commitIfNecessary(getChannel()); } }
private void rollback(long deliveryTag, Exception e) { if (isChannelTransacted()) { RabbitUtils.rollbackIfNecessary(getChannel()); } if (this.ackRequired) { try { if (this.messagesPerAck > 1) { synchronized (this) { if (this.pendingAcks > 0) { sendAck(System.currentTimeMillis()); } } } getChannel().basicNack(deliveryTag, true, ContainerUtils.shouldRequeue(isDefaultRequeueRejected(), e, this.logger)); } catch (IOException e1) { this.logger.error("Failed to nack message", e1); } } if (isChannelTransacted()) { RabbitUtils.commitIfNecessary(getChannel()); } }