uk.gov.dstl.baleen.transports.kafka.KafkaTransportSender Maven / Gradle / Ivy
The newest version!
// Copyright (c) Committed Software 2018, [email protected]
package uk.gov.dstl.baleen.transports.kafka;
import java.io.IOException;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.uima.fit.descriptor.ExternalResource;
import uk.gov.dstl.baleen.exceptions.BaleenException;
import uk.gov.dstl.baleen.resources.kafka.SharedKafkaResource;
import uk.gov.dstl.baleen.transports.components.AbstractTransportConsumer;
/**
* A transport collection reader using Kafka.
*
* This requires a {@link SharedKafkaResource} to be available to the pipeline.
*
* @baleen.javadoc
*/
public class KafkaTransportSender extends AbstractTransportConsumer {
@ExternalResource(key = SharedKafkaResource.RESOURCE_KEY)
private SharedKafkaResource kafkaResource;
private Producer