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

com.soento.logback.kafka.delivery.DeliveryStrategy Maven / Gradle / Ivy

There is a newer version: 1.2.10-RELEASE
Show newest version
package com.soento.logback.kafka.delivery;

import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;

/**
 * Interface for DeliveryStrategies.
 * @since 0.0.1
 */
public interface DeliveryStrategy {

    /**
     * Sends a message to a kafka producer and somehow deals with failures.
     *
     * @param producer the backing kafka producer
     * @param record the prepared kafka message (ready to ship)
     * @param event the originating logging event
     * @param failedDeliveryCallback a callback that handles messages that could not be delivered with best-effort.
     * @param  the key type of a persisted log message.
     * @param  the value type of a persisted log message.
     * @param  the type of the logging event.
     * @return {@code true} if the message could be sent successfully, {@code false} otherwise.
     */
     boolean send(Producer producer, ProducerRecord record, E event, FailedDeliveryCallback failedDeliveryCallback);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy