src/main/java/io/paradoxical/rabbitmq/ListenerBase.java
/**
     * Nacks or republishes with redelivery up to the configured max options
     *
     * @param message
     * @param channel
     * @throws IOException
     */
Nacks or republishes with redelivery up to the configured max options
@param message
@param channel
@throws IOException
Nacks or republishes with redelivery up to the configured max options @param message @param channel @throws IOException
private void requeue(final Message<T> message, final Channel channel) throws IOException {
        if (options.getMaxRetries() == 1) {
            nack(message.getRabbitRawMessage().getEnvelope(), channel, !message.getRabbitRawMessage().getEnvelope().isRedeliver(), message.getItem());
            return;
        }
        int publishAttempts = getPublishAttempts(message);
        if (publishAttempts < options.getMaxRetries()) {
            PublishingContext publishingContext = new PublishingContext();
            publishingContext.setPreviousPublishes(publishAttempts);
            PublisherOptions publisherOptions = PublisherOptions.builder()
                                                                .context(publishingContext)
                                                                .build();
            publishRetryMessage(message, publisherOptions, message.getRabbitRawMessage().getExchange(), channel);
        }
    }
private void requeue ( final Message < T > message , final Channel channel ) throws IOException { if ( options . getMaxRetries ( ) == 1 ) { nack ( message . getRabbitRawMessage ( ) . getEnvelope ( ) , channel , ! message . getRabbitRawMessage ( ) . getEnvelope ( ) . isRedeliver ( ) , message . getItem ( ) ) ; return ; } int publishAttempts = getPublishAttempts ( message ) ; if ( publishAttempts < options . getMaxRetries ( ) ) { PublishingContext publishingContext = new PublishingContext ( ) ; publishingContext . setPreviousPublishes ( publishAttempts ) ; PublisherOptions publisherOptions = PublisherOptions . builder ( ) . context ( publishingContext ) . build ( ) ; publishRetryMessage ( message , publisherOptions , message . getRabbitRawMessage ( ) . getExchange ( ) , channel ) ; } }
Nacks or republishes with redelivery up to the configured max options
 @param message
 @param channel
 @throws IOException
Nacks or republishes with redelivery up to the configured max options @param message @param channel @throws IOException
// if we're only allowed to retry once, we can directly use the requeue // if it wasn't already delivered once // otherwise, republish the event and update its header context // to track how many times its been published