Class ApacheKafkaProducerAdapterFactory
java.lang.Object
com.linkedin.venice.pubsub.adapter.kafka.producer.ApacheKafkaProducerAdapterFactory
- All Implemented Interfaces:
PubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
,Closeable
,AutoCloseable
public class ApacheKafkaProducerAdapterFactory
extends Object
implements PubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
Implementation of
PubSubProducerAdapterFactory
used to create Apache Kafka producers.
A producer created using this factory is usually used to send data to a single pub-sub topic.-
Constructor Details
-
ApacheKafkaProducerAdapterFactory
public ApacheKafkaProducerAdapterFactory()
-
-
Method Details
-
create
public ApacheKafkaProducerAdapter create(VeniceProperties veniceProperties, String producerName, String brokerAddressToOverride) - Specified by:
create
in interfacePubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
- Parameters:
veniceProperties
- A copy of venice properties. Relevant producer configs will be extracted from veniceProperties using prefix matching. For example, to construct kafka producer configs that start with "kafka." prefix will be used.producerName
- Name of the producer. If not null, it will be used to set the context for producer thread.brokerAddressToOverride
- Broker address to use when creating a producer. If this value is null, local broker address present in veniceProperties will be used.- Returns:
- Returns an instance of a producer adapter
-
getName
- Specified by:
getName
in interfacePubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-