@Tags(value={"kafka","record","sink"}) @CapabilityDescription(value="Provides a service to write records to a Kafka 1.x topic.") @DeprecationNotice(classNames="org.apache.nifi.record.sink.kafka.KafkaRecordSink_2_6") @DynamicProperty(name="The name of a Kafka configuration property.", value="The value of a given Kafka configuration property.", description="These properties will be added on the Kafka configuration after loading any provided configuration properties. In the event a dynamic property represents a property that was already set, its value will be ignored and WARN message logged. For the list of available Kafka properties please refer to: http://kafka.apache.org/documentation.html#configuration. ", expressionLanguageScope=VARIABLE_REGISTRY) public class KafkaRecordSink_1_0 extends AbstractControllerService implements RecordSinkService, KafkaPublishComponent
| Modifier and Type | Class and Description |
|---|---|
private static class |
KafkaRecordSink_1_0.KafkaSendException |
| Modifier and Type | Field and Description |
|---|---|
(package private) static PropertyDescriptor |
ACK_WAIT_TIME |
(package private) static PropertyDescriptor |
COMPRESSION_CODEC |
(package private) static AllowableValue |
DELIVERY_BEST_EFFORT |
(package private) static PropertyDescriptor |
DELIVERY_GUARANTEE |
(package private) static AllowableValue |
DELIVERY_ONE_NODE |
(package private) static AllowableValue |
DELIVERY_REPLICATED |
(package private) static PropertyDescriptor |
MAX_REQUEST_SIZE |
private long |
maxAckWaitMillis |
private int |
maxMessageSize |
(package private) static PropertyDescriptor |
MESSAGE_HEADER_ENCODING |
(package private) static PropertyDescriptor |
METADATA_WAIT_TIME |
private org.apache.kafka.clients.producer.Producer<byte[],byte[]> |
producer |
private List<PropertyDescriptor> |
properties |
private String |
topic |
(package private) static PropertyDescriptor |
TOPIC |
private RecordSetWriterFactory |
writerFactory |
RECORD_WRITER_FACTORYFAILURE_STRATEGYAWS_PROFILE_NAME, BOOTSTRAP_SERVERS, KERBEROS_CREDENTIALS_SERVICE, KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, KERBEROS_SERVICE_NAME, SASL_MECHANISM, SASL_PASSWORD, SASL_USERNAME, SECURITY_PROTOCOL, SELF_CONTAINED_KERBEROS_USER_SERVICE, SSL_CONTEXT_SERVICE, TOKEN_AUTHENTICATION| Constructor and Description |
|---|
KafkaRecordSink_1_0() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.kafka.clients.producer.Producer<byte[],byte[]> |
createProducer(Map<String,Object> kafkaProperties) |
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected RecordSetWriterFactory |
getWriterFactory() |
protected void |
init(ControllerServiceInitializationContext context) |
void |
onEnabled(ConfigurationContext context) |
WriteResult |
sendData(RecordSet recordSet,
Map<String,String> attributes,
boolean sendZeroResults) |
void |
stop() |
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, initialize, isEnabledequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitresetinitialize, isStatefulgetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final AllowableValue DELIVERY_REPLICATED
static final AllowableValue DELIVERY_ONE_NODE
static final AllowableValue DELIVERY_BEST_EFFORT
static final PropertyDescriptor TOPIC
static final PropertyDescriptor DELIVERY_GUARANTEE
static final PropertyDescriptor METADATA_WAIT_TIME
static final PropertyDescriptor ACK_WAIT_TIME
static final PropertyDescriptor MAX_REQUEST_SIZE
static final PropertyDescriptor COMPRESSION_CODEC
static final PropertyDescriptor MESSAGE_HEADER_ENCODING
private List<PropertyDescriptor> properties
private volatile RecordSetWriterFactory writerFactory
private volatile int maxMessageSize
private volatile long maxAckWaitMillis
private volatile String topic
private volatile org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer
protected void init(ControllerServiceInitializationContext context)
init in class AbstractControllerServiceprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentprotected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentprotected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponent@OnEnabled public void onEnabled(ConfigurationContext context) throws InitializationException
InitializationExceptionpublic WriteResult sendData(RecordSet recordSet, Map<String,String> attributes, boolean sendZeroResults) throws IOException
sendData in interface RecordSinkServiceIOException@OnDisabled public void stop()
protected RecordSetWriterFactory getWriterFactory()
Copyright © 2024 Apache NiFi Project. All rights reserved.