All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.reactive.messaging.amqp.fault.AmqpAccept Maven / Gradle / Ivy

The newest version!
package io.smallrye.reactive.messaging.amqp.fault;

import static io.smallrye.reactive.messaging.amqp.i18n.AMQPLogging.log;

import java.util.concurrent.CompletionStage;

import io.smallrye.reactive.messaging.amqp.AmqpMessage;
import io.smallrye.reactive.messaging.amqp.ConnectionHolder;
import io.vertx.mutiny.core.Context;

public class AmqpAccept implements AmqpFailureHandler {

    private final String channel;

    public AmqpAccept(String channel) {
        this.channel = channel;
    }

    @Override
    public  CompletionStage handle(AmqpMessage msg, Context context, Throwable reason) {
        // We mark the message as rejected and fail.
        log.nackedAcceptMessage(channel);
        log.fullIgnoredFailure(reason);
        return ConnectionHolder.runOnContext(context, msg, io.vertx.mutiny.amqp.AmqpMessage::accepted);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy