@Override
    public void publish(Message message, DeliveryOptions deliveryOptions) throws IOException {
        for (int attempt = 1; attempt <= DEFAULT_RETRY_ATTEMPTS; attempt++) {
            if (attempt > 1) {
                LOGGER.info("Attempt {} to send message", attempt);
            }

            try {
                Channel channel = provideChannel();
                message.publish(channel, deliveryOptions);
                LOGGER.info("Waiting for publisher ack");
                channel.waitForConfirmsOrDie();
                LOGGER.info("Received publisher ack");
                return;
            } catch (IOException e) {
                handleIoException(attempt, e);
            } catch (InterruptedException e) {
                LOGGER.warn("Publishing message interrupted while waiting for producer ack", e);
                return;
            }
        }
    }
@ Override public void publish ( Message message , DeliveryOptions deliveryOptions ) throws IOException { for ( int attempt = 1 ; attempt <= DEFAULT_RETRY_ATTEMPTS ; attempt ++ ) { if ( attempt > 1 ) { LOGGER . info ( "Attempt {} to send message" , attempt ) ; } try { Channel channel = provideChannel ( ) ; message . publish ( channel , deliveryOptions ) ; LOGGER . info ( "Waiting for publisher ack" ) ; channel . waitForConfirmsOrDie ( ) ; LOGGER . info ( "Received publisher ack" ) ; return ; } catch ( IOException e ) { handleIoException ( attempt , e ) ; } catch ( InterruptedException e ) { LOGGER . warn ( "Publishing message interrupted while waiting for producer ack" , e ) ; return ; } } }
{@inheritDoc}