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

io.quarkus.kafka.streams.runtime.HotReplacementInterceptor Maven / Gradle / Ivy

There is a newer version: 3.15.0
Show newest version
package io.quarkus.kafka.streams.runtime;

import java.util.Map;

import org.apache.kafka.clients.consumer.ConsumerInterceptor;
import org.apache.kafka.clients.consumer.ConsumerRecords;

public class HotReplacementInterceptor implements ConsumerInterceptor {

    private static volatile Runnable onMessage;

    @Override
    public void configure(Map configs) {
    }

    @Override
    public ConsumerRecords onConsume(ConsumerRecords records) {
        if (onMessage != null) {
            onMessage.run();
        }

        return records;
    }

    @Override
    public void onCommit(Map offsets) {
    }

    @Override
    public void close() {
    }

    public static void onMessage(Runnable handler) {
        onMessage = handler;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy