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

ru.yandex.qatools.camelot.kafka.KafkaInterimProcessor Maven / Gradle / Ivy

There is a newer version: 2.5.4
Show newest version
package ru.yandex.qatools.camelot.kafka;

import org.apache.camel.Exchange;
import ru.yandex.qatools.camelot.common.InterimProcessor;

import java.util.HashSet;

/**
 * @author Ilya Sadykov
 */
public class KafkaInterimProcessor implements InterimProcessor {

    @Override
    public void process(Exchange exchange) throws Exception { //NOSONAR
        // Cleaning up the kafka headers as they must be set by kafka producer from scratch
        for (String header : new HashSet<>(exchange.getIn().getHeaders().keySet())) {
            if (header.startsWith("kafka")) {
                exchange.getIn().removeHeader(header);
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy