src/main/java/edu/ucla/library/bucketeer/verticles/AbstractBucketeerVerticle.java
protected void sendMessage(final Promise<Void> aPromise, final JsonObject aJsonObject, final String aVerticleName,
            final long aTimeout) {
        final DeliveryOptions options = new DeliveryOptions().setSendTimeout(aTimeout);

        vertx.eventBus().request(aVerticleName, aJsonObject, options, response -> {
            if (response.failed()) {
                if (response.cause() != null) {
                    getLogger().error(response.cause(), MessageCodes.BUCKETEER_005, aVerticleName, aJsonObject);
                } else {
                    getLogger().error(MessageCodes.BUCKETEER_005, aVerticleName, aJsonObject);
                }

                aPromise.fail(response.cause());
            } else if (response.result().body().equals(Op.RETRY)) {
                getLogger().debug(MessageCodes.BUCKETEER_048, aVerticleName);
                sendMessage(aPromise, aJsonObject, aVerticleName, aTimeout);
            } else {
                aPromise.complete();
            }
        });
    }
/**
     * Sends a message to another verticle with a supplied timeout value.
     *
     * @param aPromise A promise that the message is sent
     * @param aJsonObject A JSON message
     * @param aVerticleName A verticle name that will respond to the message
     * @param aTimeout A timeout measured in milliseconds
     */
Sends a message to another verticle with a supplied timeout value.
@param aPromise A promise that the message is sent
@param aJsonObject A JSON message
@param aVerticleName A verticle name that will respond to the message
@param aTimeout A timeout measured in milliseconds
Sends a message to another verticle with a supplied timeout value . @param aPromise A promise that the message is sent @param aJsonObject A JSON message @param aVerticleName A verticle name that will respond to the message @param aTimeout A timeout measured in milliseconds
protected void sendMessage(final Promise<Void> aPromise, final JsonObject aJsonObject, final String aVerticleName,
            final long aTimeout) {
        final DeliveryOptions options = new DeliveryOptions().setSendTimeout(aTimeout);
        vertx.eventBus().request(aVerticleName, aJsonObject, options, response -> {
            if (response.failed()) {
                if (response.cause() != null) {
                    getLogger().error(response.cause(), MessageCodes.BUCKETEER_005, aVerticleName, aJsonObject);
                } else {
                    getLogger().error(MessageCodes.BUCKETEER_005, aVerticleName, aJsonObject);
                }
                aPromise.fail(response.cause());
            } else if (response.result().body().equals(Op.RETRY)) {
                getLogger().debug(MessageCodes.BUCKETEER_048, aVerticleName);
                sendMessage(aPromise, aJsonObject, aVerticleName, aTimeout);
            } else {
                aPromise.complete();
            }
        });
    }
protected void sendMessage ( final Promise < Void > aPromise , final JsonObject aJsonObject , final String aVerticleName , final long aTimeout ) { final DeliveryOptions options = new DeliveryOptions ( ) . setSendTimeout ( aTimeout ) ; vertx . eventBus ( ) . request ( aVerticleName , aJsonObject , options , response -> { if ( response . failed ( ) ) { if ( response . cause ( ) != null ) { getLogger ( ) . error ( response . cause ( ) , MessageCodes . BUCKETEER_005 , aVerticleName , aJsonObject ) ; } else { getLogger ( ) . error ( MessageCodes . BUCKETEER_005 , aVerticleName , aJsonObject ) ; } aPromise . fail ( response . cause ( ) ) ; } else if ( response . result ( ) . body ( ) . equals ( Op . RETRY ) ) { getLogger ( ) . debug ( MessageCodes . BUCKETEER_048 , aVerticleName ) ; sendMessage ( aPromise , aJsonObject , aVerticleName , aTimeout ) ; } else { aPromise . complete ( ) ; } } ) ; }
Sends a message to another verticle with a supplied timeout value.
Sends a message to another verticle with a supplied timeout value .