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

io.smallrye.reactive.messaging.mqtt.MqttIgnoreFailure Maven / Gradle / Ivy

There is a newer version: 4.24.0
Show newest version
package io.smallrye.reactive.messaging.mqtt;

import static io.smallrye.reactive.messaging.mqtt.i18n.MqttLogging.log;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;

public class MqttIgnoreFailure implements MqttFailureHandler {

    private final String channel;

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

    @Override
    public CompletionStage handle(Throwable reason) {
        // We commit the message, log and continue

        log.messageNackedIgnore(channel, reason.getMessage());
        log.messageNackedFullIgnored(reason);
        return CompletableFuture.completedFuture(null);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy