Class ApacheKafkaProducerAdapterFactory
- java.lang.Object
-
- com.linkedin.venice.pubsub.adapter.kafka.producer.ApacheKafkaProducerAdapterFactory
-
- All Implemented Interfaces:
PubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
,java.io.Closeable
,java.lang.AutoCloseable
public class ApacheKafkaProducerAdapterFactory extends java.lang.Object implements PubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
Implementation ofPubSubProducerAdapterFactory
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 Summary
Constructors Constructor Description ApacheKafkaProducerAdapterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
ApacheKafkaProducerAdapter
create(VeniceProperties veniceProperties, java.lang.String producerName, java.lang.String brokerAddressToOverride)
java.lang.String
getName()
-
-
-
Method Detail
-
create
public ApacheKafkaProducerAdapter create(VeniceProperties veniceProperties, java.lang.String producerName, java.lang.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
public java.lang.String getName()
- Specified by:
getName
in interfacePubSubProducerAdapterFactory<ApacheKafkaProducerAdapter>
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-