blob: cc06c2e5288bc097397686711cf8db6b71eb1241 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>ConsumeKafka_1_0</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">ConsumeKafka_1_0</h1><h2>Description: </h2><p>Consumes messages from Apache Kafka specifically built against the Kafka 1.0 Consumer API. The complementary NiFi processor for sending messages is PublishKafka_1_0.</p><p><a href="additionalDetails.html">Additional Details...</a></p><h3>Tags: </h3><p>Kafka, Get, Ingest, Ingress, Topic, PubSub, Consume, 1.0</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Kafka Brokers</strong></td><td>bootstrap.servers</td><td id="default-value">localhost:9092</td><td id="allowable-values"></td><td id="description">A comma-separated list of known Kafka Brokers in the format &lt;host&gt;:&lt;port&gt;<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name"><strong>Security Protocol</strong></td><td>security.protocol</td><td id="default-value">PLAINTEXT</td><td id="allowable-values"><ul><li>PLAINTEXT <img src="../../../../../html/images/iconInfo.png" alt="PLAINTEXT" title="PLAINTEXT"></img></li><li>SSL <img src="../../../../../html/images/iconInfo.png" alt="SSL" title="SSL"></img></li><li>SASL_PLAINTEXT <img src="../../../../../html/images/iconInfo.png" alt="SASL_PLAINTEXT" title="SASL_PLAINTEXT"></img></li><li>SASL_SSL <img src="../../../../../html/images/iconInfo.png" alt="SASL_SSL" title="SASL_SSL"></img></li></ul></td><td id="description">Protocol used to communicate with brokers. Corresponds to Kafka's 'security.protocol' property.</td></tr><tr><td id="name">Kerberos Service Name</td><td>sasl.kerberos.service.name</td><td></td><td id="allowable-values"></td><td id="description">The service name that matches the primary name of the Kafka server configured in the broker JAAS file.This can be defined either in Kafka's JAAS config or in Kafka's config. Corresponds to Kafka's 'security.protocol' property.It is ignored unless one of the SASL options of the &lt;Security Protocol&gt; are selected.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Kerberos Credentials Service</td><td>kerberos-credentials-service</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>KerberosCredentialsService<br/><strong>Implementation: </strong><a href="../../../nifi-kerberos-credentials-service-nar/1.19.0/org.apache.nifi.kerberos.KeytabCredentialsService/index.html">KeytabCredentialsService</a></td><td id="description">Specifies the Kerberos Credentials Controller Service that should be used for authenticating with Kerberos</td></tr><tr><td id="name">Kerberos Principal</td><td>sasl.kerberos.principal</td><td></td><td id="allowable-values"></td><td id="description">The Kerberos principal that will be used to connect to brokers. If not set, it is expected to set a JAAS configuration file in the JVM properties defined in the bootstrap.conf file. This principal will be set into 'sasl.jaas.config' Kafka's property.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Kerberos Keytab</td><td>sasl.kerberos.keytab</td><td></td><td id="allowable-values"></td><td id="description">The Kerberos keytab that will be used to connect to brokers. If not set, it is expected to set a JAAS configuration file in the JVM properties defined in the bootstrap.conf file. This principal will be set into 'sasl.jaas.config' Kafka's property.<br/><br/><strong>This property requires exactly one file to be provided..</strong><br/><br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">SSL Context Service</td><td>ssl.context.service</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>SSLContextService<br/><strong>Implementations: </strong><a href="../../../nifi-ssl-context-service-nar/1.19.0/org.apache.nifi.ssl.StandardRestrictedSSLContextService/index.html">StandardRestrictedSSLContextService</a><br/><a href="../../../nifi-ssl-context-service-nar/1.19.0/org.apache.nifi.ssl.StandardSSLContextService/index.html">StandardSSLContextService</a></td><td id="description">Specifies the SSL Context Service to use for communicating with Kafka.</td></tr><tr><td id="name"><strong>Topic Name(s)</strong></td><td>topic</td><td></td><td id="allowable-values"></td><td id="description">The name of the Kafka Topic(s) to pull from. More than one can be supplied if comma separated.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name"><strong>Topic Name Format</strong></td><td>topic_type</td><td id="default-value">names</td><td id="allowable-values"><ul><li>names <img src="../../../../../html/images/iconInfo.png" alt="Topic is a full topic name or comma separated list of names" title="Topic is a full topic name or comma separated list of names"></img></li><li>pattern <img src="../../../../../html/images/iconInfo.png" alt="Topic is a regex using the Java Pattern syntax" title="Topic is a regex using the Java Pattern syntax"></img></li></ul></td><td id="description">Specifies whether the Topic(s) provided are a comma separated list of names or a single regular expression</td></tr><tr><td id="name"><strong>Honor Transactions</strong></td><td>honor-transactions</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Specifies whether or not NiFi should honor transactional guarantees when communicating with Kafka. If false, the Processor will use an "isolation level" of read_uncomitted. This means that messages will be received as soon as they are written to Kafka but will be pulled, even if the producer cancels the transactions. If this value is true, NiFi will not receive any messages for which the producer's transaction was canceled, but this can result in some latency since the consumer must wait for the producer to finish its entire transaction instead of pulling as the messages become available.</td></tr><tr><td id="name"><strong>Group ID</strong></td><td>group.id</td><td></td><td id="allowable-values"></td><td id="description">A Group ID is used to identify consumers that are within the same consumer group. Corresponds to Kafka's 'group.id' property.<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name"><strong>Offset Reset</strong></td><td>auto.offset.reset</td><td id="default-value">latest</td><td id="allowable-values"><ul><li>earliest <img src="../../../../../html/images/iconInfo.png" alt="Automatically reset the offset to the earliest offset" title="Automatically reset the offset to the earliest offset"></img></li><li>latest <img src="../../../../../html/images/iconInfo.png" alt="Automatically reset the offset to the latest offset" title="Automatically reset the offset to the latest offset"></img></li><li>none <img src="../../../../../html/images/iconInfo.png" alt="Throw exception to the consumer if no previous offset is found for the consumer's group" title="Throw exception to the consumer if no previous offset is found for the consumer's group"></img></li></ul></td><td id="description">Allows you to manage the condition when there is no initial offset in Kafka or if the current offset does not exist any more on the server (e.g. because that data has been deleted). Corresponds to Kafka's 'auto.offset.reset' property.</td></tr><tr><td id="name"><strong>Key Attribute Encoding</strong></td><td>key-attribute-encoding</td><td id="default-value">UTF-8 Encoded</td><td id="allowable-values"><ul><li>UTF-8 Encoded <img src="../../../../../html/images/iconInfo.png" alt="The key is interpreted as a UTF-8 Encoded string." title="The key is interpreted as a UTF-8 Encoded string."></img></li><li>Hex Encoded <img src="../../../../../html/images/iconInfo.png" alt="The key is interpreted as arbitrary binary data and is encoded using hexadecimal characters with uppercase letters" title="The key is interpreted as arbitrary binary data and is encoded using hexadecimal characters with uppercase letters"></img></li></ul></td><td id="description">FlowFiles that are emitted have an attribute named 'kafka.key'. This property dictates how the value of the attribute should be encoded.</td></tr><tr><td id="name">Message Demarcator</td><td>message-demarcator</td><td></td><td id="allowable-values"></td><td id="description">Since KafkaConsumer receives messages in batches, you have an option to output FlowFiles which contains all Kafka messages in a single batch for a given topic and partition and this property allows you to provide a string (interpreted as UTF-8) to use for demarcating apart multiple Kafka messages. This is an optional property and if not provided each Kafka message received will result in a single FlowFile which time it is triggered. To enter special character such as 'new line' use CTRL+Enter or Shift+Enter depending on the OS<br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr><tr><td id="name">Message Header Encoding</td><td>message-header-encoding</td><td id="default-value">UTF-8</td><td id="allowable-values"></td><td id="description">Any message header that is found on a Kafka message will be added to the outbound FlowFile as an attribute. This property indicates the Character Encoding to use for deserializing the headers.</td></tr><tr><td id="name">Headers to Add as Attributes (Regex)</td><td>header-name-regex</td><td></td><td id="allowable-values"></td><td id="description">A Regular Expression that is matched against all message headers. Any message header whose name matches the regex will be added to the FlowFile as an Attribute. If not specified, no Header values will be added as FlowFile attributes. If two messages have a different value for the same header and that header is selected by the provided regex, then those two messages must be added to different FlowFiles. As a result, users should be cautious about using a regex like ".*" if messages are expected to have header values that are unique per message, such as an identifier or timestamp, because it will prevent NiFi from bundling the messages together efficiently.</td></tr><tr><td id="name">Max Poll Records</td><td>max.poll.records</td><td id="default-value">10000</td><td id="allowable-values"></td><td id="description">Specifies the maximum number of records Kafka should return in a single poll.</td></tr><tr><td id="name">Max Uncommitted Time</td><td>max-uncommit-offset-wait</td><td id="default-value">1 secs</td><td id="allowable-values"></td><td id="description">Specifies the maximum amount of time allowed to pass before offsets must be committed. This value impacts how often offsets will be committed. Committing offsets less often increases throughput but also increases the window of potential data duplication in the event of a rebalance or JVM restart between commits. This value is also related to maximum poll records and the use of a message demarcator. When using a message demarcator we can have far more uncommitted messages than when we're not as there is much less for us to keep track of in memory.</td></tr></table><h3>Dynamic Properties: </h3><p>Supports Sensitive Dynamic Properties: <strong>No</strong></p><p>Dynamic Properties allow the user to specify both the name and value of a property.<table id="dynamic-properties"><tr><th>Name</th><th>Value</th><th>Description</th></tr><tr><td id="name">The name of a Kafka configuration property.</td><td id="value">The value of a given Kafka configuration property.</td><td>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. <br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong></td></tr></table></p><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>FlowFiles received from Kafka. Depending on demarcation strategy it is a flow file per message or a bundle of messages grouped by topic and partition.</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>kafka.count</td><td>The number of messages written if more than one</td></tr><tr><td>kafka.key</td><td>The key of message if present and if single message. How the key is encoded depends on the value of the 'Key Attribute Encoding' property.</td></tr><tr><td>kafka.offset</td><td>The offset of the message in the partition of the topic.</td></tr><tr><td>kafka.timestamp</td><td>The timestamp of the message in the partition of the topic.</td></tr><tr><td>kafka.partition</td><td>The partition of the topic the message or message bundle is from</td></tr><tr><td>kafka.topic</td><td>The topic the message or message bundle is from</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component does not allow an incoming relationship.<h3>System Resource Considerations:</h3>None specified.</body></html>