src/main/java/edu/ucla/library/bucketeer/verticles/ImageWorkerVerticle.java
private void sendImageRequest(final String aListener, final JsonObject aJsonObject, final Promise<Void> aPromise) {
        final DeliveryOptions options = new DeliveryOptions().setSendTimeout(Integer.MAX_VALUE);
        final Vertx vertx = getVertx();

        options.addHeader(Constants.DERIVATIVE_IMAGE, Boolean.toString(true));

        vertx.eventBus().request(aListener, aJsonObject, options, response -> {
            if (response.failed()) {
                final Throwable exception = response.cause();

                if (exception != null) {
                    if (exception instanceof ReplyException) {
                        final ReplyException replyException = (ReplyException) exception;
                        final String messageCode = CodeUtils.getCode(replyException.failureCode());
                        final String exceptionMessage = LOGGER.getMessage(messageCode, replyException.getMessage());

                        LOGGER.error(replyException, MessageCodes.BUCKETEER_005, aListener, exceptionMessage);
                    } else {
                        LOGGER.error(exception, MessageCodes.BUCKETEER_005, aListener, exception.getMessage());
                    }
                } else {
                    LOGGER.error(MessageCodes.BUCKETEER_005, aListener, MessageCodes.BUCKETEER_136);
                }

                aPromise.fail(exception);
            } else if (response.result().body().equals(Op.RETRY)) {
                vertx.setTimer(myRequeueDelay, timer -> {
                    sendImageRequest(aListener, aJsonObject, aPromise);
                });
            } else {
                aPromise.complete();
            }
        });
    }
/**
     * This message sender is specifically for item processing requests; it behaves differently from the default message
     * sender that our other handlers use.
     *
     * @param aJsonObject A message with information about the image to upload
     * @param aListener The destination of the message
     * @param aPromise A promise that the JP2/JPX image has been uploaded
     */
This message sender is specifically for item processing requests; it behaves differently from the default message
sender that our other handlers use.

@param aJsonObject A message with information about the image to upload
@param aListener The destination of the message
@param aPromise A promise that the JP2/JPX image has been uploaded
This message sender is specifically for item processing requests ; it behaves differently from the default message sender that our other handlers use . @param aJsonObject A message with information about the image to upload @param aListener The destination of the message @param aPromise A promise that the JP2 / JPX image has been uploaded
private void sendImageRequest(final String aListener, final JsonObject aJsonObject, final Promise<Void> aPromise) {
        final DeliveryOptions options = new DeliveryOptions().setSendTimeout(Integer.MAX_VALUE);
        final Vertx vertx = getVertx();
        options.addHeader(Constants.DERIVATIVE_IMAGE, Boolean.toString(true));
        vertx.eventBus().request(aListener, aJsonObject, options, response -> {
            if (response.failed()) {
                final Throwable exception = response.cause();
                if (exception != null) {
                    if (exception instanceof ReplyException) {
                        final ReplyException replyException = (ReplyException) exception;
                        final String messageCode = CodeUtils.getCode(replyException.failureCode());
                        final String exceptionMessage = LOGGER.getMessage(messageCode, replyException.getMessage());
                        LOGGER.error(replyException, MessageCodes.BUCKETEER_005, aListener, exceptionMessage);
                    } else {
                        LOGGER.error(exception, MessageCodes.BUCKETEER_005, aListener, exception.getMessage());
                    }
                } else {
                    LOGGER.error(MessageCodes.BUCKETEER_005, aListener, MessageCodes.BUCKETEER_136);
                }
                aPromise.fail(exception);
            } else if (response.result().body().equals(Op.RETRY)) {
                vertx.setTimer(myRequeueDelay, timer -> {
                    sendImageRequest(aListener, aJsonObject, aPromise);
                });
            } else {
                aPromise.complete();
            }
        });
    }
private void sendImageRequest ( final String aListener , final JsonObject aJsonObject , final Promise < Void > aPromise ) { final DeliveryOptions options = new DeliveryOptions ( ) . setSendTimeout ( Integer . MAX_VALUE ) ; final Vertx vertx = getVertx ( ) ; options . addHeader ( Constants . DERIVATIVE_IMAGE , Boolean . toString ( true ) ) ; vertx . eventBus ( ) . request ( aListener , aJsonObject , options , response -> { if ( response . failed ( ) ) { final Throwable exception = response . cause ( ) ; if ( exception != null ) { if ( exception instanceof ReplyException ) { final ReplyException replyException = ( ReplyException ) exception ; final String messageCode = CodeUtils . getCode ( replyException . failureCode ( ) ) ; final String exceptionMessage = LOGGER . getMessage ( messageCode , replyException . getMessage ( ) ) ; LOGGER . error ( replyException , MessageCodes . BUCKETEER_005 , aListener , exceptionMessage ) ; } else { LOGGER . error ( exception , MessageCodes . BUCKETEER_005 , aListener , exception . getMessage ( ) ) ; } } else { LOGGER . error ( MessageCodes . BUCKETEER_005 , aListener , MessageCodes . BUCKETEER_136 ) ; } aPromise . fail ( exception ) ; } else if ( response . result ( ) . body ( ) . equals ( Op . RETRY ) ) { vertx . setTimer ( myRequeueDelay , timer -> { sendImageRequest ( aListener , aJsonObject , aPromise ) ; } ) ; } else { aPromise . complete ( ) ; } } ) ; }
This message sender is specifically for item processing requests; it behaves differently from the default message
 sender that our other handlers use.
This message sender is specifically for item processing requests ; it behaves differently from the default message sender that our other handlers use .