Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 11589200D1E for ; Tue, 3 Oct 2017 15:30:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1021E160BD5; Tue, 3 Oct 2017 13:30:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 15880160BE0 for ; Tue, 3 Oct 2017 15:30:38 +0200 (CEST) Received: (qmail 29635 invoked by uid 500); 3 Oct 2017 13:30:38 -0000 Mailing-List: contact commits-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list commits@nifi.apache.org Received: (qmail 29609 invoked by uid 99); 3 Oct 2017 13:30:38 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2017 13:30:38 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 787FB3A0AC5 for ; Tue, 3 Oct 2017 13:30:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1811008 [11/43] - in /nifi/site/trunk/docs: ./ nifi-docs/ nifi-docs/components/ nifi-docs/components/org.apache.nifi/ nifi-docs/components/org.apache.nifi/nifi-ambari-nar/ nifi-docs/components/org.apache.nifi/nifi-ambari-nar/1.4.0/ nifi-do... Date: Tue, 03 Oct 2017 13:30:27 -0000 To: commits@nifi.apache.org From: jstorck@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171003133034.787FB3A0AC5@svn01-us-west.apache.org> archived-at: Tue, 03 Oct 2017 13:30:41 -0000 Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/additionalDetails.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/additionalDetails.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/additionalDetails.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/additionalDetails.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1,142 @@ + + + + + + ConsumeKafka + + + + + +

Description:

+

+ This Processor polls Apache Kafka + for data using KafkaConsumer API available with Kafka 0.10.x. When a message is received + from Kafka, this Processor emits a FlowFile where the content of the FlowFile is the value + of the Kafka message. +

+

Security Configuration:

+

+ The Security Protocol property allows the user to specify the protocol for communicating + with the Kafka broker. The following sections describe each of the protocols in further detail. +

+

PLAINTEXT

+

+ This option provides an unsecured connection to the broker, with no client authentication and no encryption. + In order to use this option the broker must be configured with a listener of the form: +

+    PLAINTEXT://host.name:port
+            
+

+

SSL

+

+ This option provides an encrypted connection to the broker, with optional client authentication. In order + to use this option the broker must be configured with a listener of the form: +

+    SSL://host.name:port
+            
+ In addition, the processor must have an SSL Context Service selected. +

+

+ If the broker specifies ssl.client.auth=none, or does not specify ssl.client.auth, then the client will + not be required to present a certificate. In this case, the SSL Context Service selected may specify only + a truststore containing the public key of the certificate authority used to sign the broker's key. +

+

+ If the broker specifies ssl.client.auth=required then the client will be required to present a certificate. + In this case, the SSL Context Service must also specify a keystore containing a client key, in addition to + a truststore as described above. +

+

SASL_PLAINTEXT

+

+ This option uses SASL with a PLAINTEXT transport layer to authenticate to the broker. In order to use this + option the broker must be configured with a listener of the form: +

+    SASL_PLAINTEXT://host.name:port
+            
+ In addition, the Kerberos Service Name must be specified in the processor. +

+

SASL_PLAINTEXT - GSSAPI

+

+ If the SASL mechanism is GSSAPI, then the client must provide a JAAS configuration to authenticate. The + JAAS configuration can be provided by specifying the java.security.auth.login.config system property in + NiFi's bootstrap.conf, such as: +

+    java.arg.16=-Djava.security.auth.login.config=/path/to/kafka_client_jaas.conf
+            
+

+

+ An example of the JAAS config file would be the following: +

+    KafkaClient {
+        com.sun.security.auth.module.Krb5LoginModule required
+        useKeyTab=true
+        storeKey=true
+        keyTab="/path/to/nifi.keytab"
+        serviceName="kafka"
+        principal="nifi@YOURREALM.COM";
+    };
+            
+ NOTE: The serviceName in the JAAS file must match the Kerberos Service Name in the processor. +

+

+ Alternatively, starting with Apache NiFi 1.2.0 which uses the Kafka 0.10.2 client, the JAAS + configuration when using GSSAPI can be provided by specifying the Kerberos Principal and Kerberos Keytab + directly in the processor properties. This will dynamically create a JAAS configuration like above, and + will take precedence over the java.security.auth.login.config system property. +

+

SASL_PLAINTEXT - PLAIN

+

+ If the SASL mechanism is PLAIN, then client must provide a JAAS configuration to authenticate, but + the JAAS configuration must use Kafka's PlainLoginModule. An example of the JAAS config file would + be the following: +

+    KafkaClient {
+      org.apache.kafka.common.security.plain.PlainLoginModule required
+      username="nifi"
+      password="nifi-password";
+    };
+            
+

+

+ NOTE: It is not recommended to use a SASL mechanism of PLAIN with SASL_PLAINTEXT, as it would transmit + the username and password unencrypted. +

+

+ NOTE: Using the PlainLoginModule will cause it be registered in the JVM's static list of Providers, making + it visible to components in other NARs that may access the providers. There is currently a known issue + where Kafka processors using the PlainLoginModule will cause HDFS processors with Keberos to no longer work. +

+

SASL_SSL

+

+ This option uses SASL with an SSL/TLS transport layer to authenticate to the broker. In order to use this + option the broker must be configured with a listener of the form: +

+    SASL_SSL://host.name:port
+            
+

+

+ See the SASL_PLAINTEXT section for a description of how to provide the proper JAAS configuration + depending on the SASL mechanism (GSSAPI or PLAIN). +

+

+ See the SSL section for a description of how to configure the SSL Context Service based on the + ssl.client.auth property. +

+ + + Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/index.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/index.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/index.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafka_0_10/index.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1 @@ +ConsumeKafka_0_10

ConsumeKafka_0_10

Description:

Consumes messages from Apache Kafka specifically built against the Kafka 0.10.x Consumer API. Please note there are cases where the publisher can get into an indefinite stuck state. We are closely monitoring how this evolves in the Kafka community and will take advantage of those fixes as soon as we can. In the meantime it is possible to enter states where the only resolution will be to restart the JVM NiFi runs on. The complementary NiFi processor for sending messages is PublishKafka_0_10.

Additional Deta ils...

Tags:

Kafka, Get, Ingest, Ingress, Topic, PubSub, Consume, 0.10.x

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Kafka Brokerslocalhost:9092A comma-separated list of known Kafka Brokers in the format <host>:<port>
Supports Expression Language: true
Security ProtocolPLAINTEXT
  • PLAINTEXT PLAINTEXT
  • SSL SSL
  • SASL_PLAINTEXT SASL_PLAINTEXT
  • SASL_SSL SASL_SSL
Protocol used to communicate with brokers. Corresponds to Kafka's 'security.protocol' property.
Kerberos Service NameThe Kerberos principal name that Kafka runs as. 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 <Security Protocol> are selected.
Kerberos PrincipalThe 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.
Kerberos KeytabThe 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.
SSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
Specifies the SSL Context Service to use for communicating with Kafka.
Topic Name(s)The name of the Kafka Topic(s) to pull from. More than one can be supplied if comma separated.
Supports Expression Language: true
Topic Name Formatnames
  • names Topic is a full topic name or comma separated list of names
  • pattern
Specifies whether the Topic(s) provided are a comma separated list of names or a single regular expression
Group IDA Group ID is used to identify consumers that are within the same consumer group. Corresponds to Kafka's 'group.id' property.
Offset Resetlatest
  • earliest Automatically reset the offset to the earliest offset
  • latest Automatically reset the offset to the latest offset
  • none Throw exception to the consumer if no previous offset is found for the consumer's group
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.
Key Attribute Encodingutf-8
  • UTF-8 Encoded The key is interpreted as a UTF-8 Encoded string.
  • Hex Encoded The key is interpreted as arbitrary
  binary data and is encoded using hexadecimal characters with uppercase letters
FlowFiles that are emitted have an attribute named 'kafka.key'. This property dictates how the value of the attribute should be encoded.
Message DemarcatorSince 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
Supports Expression Language: true
Max Poll Records10000Specifies the maximum number of records Kafka should return in a single poll.
Max Uncommitted Time1 secsSpecifies 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.

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.
NameValueDescription
The name of a Kafka configuration property.The value of a given Kafka configuration property.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.

Relationships:

NameDescription
successFlowFiles received from Kafka. Depending on demarcation strategy it is a flow file per message or a bundle of messages grouped by topic and partition.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
kafka.countThe number of messages written if more than one
kafka.keyThe key of message if present and if single message. How the key is encoded depends on the value of the 'Key Attribute Encoding' property.
kafka.offsetThe offset of the message in the partition of the topic.
kafka.partitionThe partition of the topic the message or message bundle is from
kafka.topicThe topic the message or message bundle is from

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component does not allow an incoming relationship. \ No newline at end of file Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/additionalDetails.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/additionalDetails.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/additionalDetails.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/additionalDetails.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1,143 @@ + + + + + + PublishKafka + + + + + +

Description:

+

+ This Processor puts the contents of a FlowFile to a Topic in + Apache Kafka using KafkaProducer API available + with Kafka 0.10.x API. The contents of the incoming FlowFile will be read using the + configured Record Reader. Each record will then be serialized using the configured + Record Writer, and this serialized form will be the content of a Kafka message. + This message is optionally assigned a key by using the <Kafka Key> Property. +

+

Security Configuration:

+

+ The Security Protocol property allows the user to specify the protocol for communicating + with the Kafka broker. The following sections describe each of the protocols in further detail. +

+

PLAINTEXT

+

+ This option provides an unsecured connection to the broker, with no client authentication and no encryption. + In order to use this option the broker must be configured with a listener of the form: +

+    PLAINTEXT://host.name:port
+            
+

+

SSL

+

+ This option provides an encrypted connection to the broker, with optional client authentication. In order + to use this option the broker must be configured with a listener of the form: +

+    SSL://host.name:port
+            
+ In addition, the processor must have an SSL Context Service selected. +

+

+ If the broker specifies ssl.client.auth=none, or does not specify ssl.client.auth, then the client will + not be required to present a certificate. In this case, the SSL Context Service selected may specify only + a truststore containing the public key of the certificate authority used to sign the broker's key. +

+

+ If the broker specifies ssl.client.auth=required then the client will be required to present a certificate. + In this case, the SSL Context Service must also specify a keystore containing a client key, in addition to + a truststore as described above. +

+

SASL_PLAINTEXT

+

+ This option uses SASL with a PLAINTEXT transport layer to authenticate to the broker. In order to use this + option the broker must be configured with a listener of the form: +

+    SASL_PLAINTEXT://host.name:port
+            
+ In addition, the Kerberos Service Name must be specified in the processor. +

+

SASL_PLAINTEXT - GSSAPI

+

+ If the SASL mechanism is GSSAPI, then the client must provide a JAAS configuration to authenticate. The + JAAS configuration can be provided by specifying the java.security.auth.login.config system property in + NiFi's bootstrap.conf, such as: +

+    java.arg.16=-Djava.security.auth.login.config=/path/to/kafka_client_jaas.conf
+            
+

+

+ An example of the JAAS config file would be the following: +

+    KafkaClient {
+        com.sun.security.auth.module.Krb5LoginModule required
+        useKeyTab=true
+        storeKey=true
+        keyTab="/path/to/nifi.keytab"
+        serviceName="kafka"
+        principal="nifi@YOURREALM.COM";
+    };
+            
+ NOTE: The serviceName in the JAAS file must match the Kerberos Service Name in the processor. +

+

+ Alternatively, starting with Apache NiFi 1.2.0 which uses the Kafka 0.10.2 client, the JAAS + configuration when using GSSAPI can be provided by specifying the Kerberos Principal and Kerberos Keytab + directly in the processor properties. This will dynamically create a JAAS configuration like above, and + will take precedence over the java.security.auth.login.config system property. +

+

SASL_PLAINTEXT - PLAIN

+

+ If the SASL mechanism is PLAIN, then client must provide a JAAS configuration to authenticate, but + the JAAS configuration must use Kafka's PlainLoginModule. An example of the JAAS config file would + be the following: +

+    KafkaClient {
+      org.apache.kafka.common.security.plain.PlainLoginModule required
+      username="nifi"
+      password="nifi-password";
+    };
+            
+

+

+ NOTE: It is not recommended to use a SASL mechanism of PLAIN with SASL_PLAINTEXT, as it would transmit + the username and password unencrypted. +

+

+ NOTE: Using the PlainLoginModule will cause it be registered in the JVM's static list of Providers, making + it visible to components in other NARs that may access the providers. There is currently a known issue + where Kafka processors using the PlainLoginModule will cause HDFS processors with Keberos to no longer work. +

+

SASL_SSL

+

+ This option uses SASL with an SSL/TLS transport layer to authenticate to the broker. In order to use this + option the broker must be configured with a listener of the form: +

+    SASL_SSL://host.name:port
+            
+

+

+ See the SASL_PLAINTEXT section for a description of how to provide the proper JAAS configuration + depending on the SASL mechanism (GSSAPI or PLAIN). +

+

+ See the SSL section for a description of how to configure the SSL Context Service based on the + ssl.client.auth property. +

+ + Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/index.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/index.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/index.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_0_10/index.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1 @@ +PublishKafkaRecord_0_10

PublishKafkaRecord_0_10

Description:

Sends the contents of a FlowFile as individual records to Apache Kafka using the Kafka 0.10.x Producer API. The contents of the FlowFile are expected to be record-oriented data that can be read by the configured Record Reader. Please note there are cases where the publisher can get into an indefinite stuck state. We are closely monitoring how this evolves in the Kafka community and will take advantage of those fixes as soon as we can. In the meantime it is possible to enter states where the only resolution will be to restart the JVM NiFi runs on. The complementary NiFi processor for fetching messages is ConsumeKafka_0_10_Record.

Additional Details...

Tags:

Apache, Kafka, Record, csv, json, avro, logs, Put, Send, Message, PubSub, 0.10.x

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Kafka Brokerslocalhost:9092A comma-separated list of known Kafka Brokers in the format <host>:<port>
Supports Expression Languag e: true
Topic NameThe name of the Kafka Topic to publish to.
Supports Expression Language: true
Record ReaderController Service API:
RecordReaderFactory
Implementations: CSVReader
GrokReader
AvroReader
JsonTreeReader
JsonPathReader
ScriptedReader
The Record Reader to use for incoming FlowFiles
Record WriterController Service API:
RecordSetWriterFactory
Implementations: JsonRecordSetWriter
FreeFormTextRecordSetWriter
AvroRecordSetWriter
ScriptedRecordSetWriter
CSVRecordSetWriter
The Record Writer to use in order to serialize the data before sending to Kafka
Security ProtocolPLAINTEXT
  • PLAINTEXT PLAINTEXT
  • SSL SSL
  • SASL_PLAINTEXT SASL_PLAINTEXT
  • SASL_SSL SASL_SSL
Protocol used to communicate with brokers. Corresponds to Kafka's 'security.protocol' property.
Kerberos Service NameThe Kerberos principal name that Kafka runs as. 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 <Security Protocol> are selected.
Kerberos PrincipalThe 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.
Kerberos KeytabThe 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.
SSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
Specifies the SSL Context Service to use for communicating with Kafka.
Delivery Guarantee0
  • Best Effort FlowFile will be routed to success after successfully writing the content to a Kafka node, without waiting for a response. This provides the best performance but may result in data loss.
  • Guarantee Single Node Delivery FlowFile will be routed to success if the message is received by a single Kafka node, whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> but can result in data loss if a Kafka node crashes
  • < li>Guarantee Replicated Delivery FlowFile will be routed to failure unless the message is replicated to the appropriate number of Kafka Nodes according to the Topic configuration
Specifies the requirement for guaranteeing that a message is sent to Kafka. Corresponds to Kafka's 'acks' property.
Message Key FieldThe name of a field in the Input Records that should be used as the Key for the Kafka message.
Supports Expression Language: true
Max Request Size1 MBThe maximum size of a request in bytes. Corresponds to Kafka's 'max.request.size' property and defaults to 1 MB (1048576).
Acknowledgment Wait Time5 secsAfter sending a message to Kafka, this indicates the amount of time that we are willing to wait for a response from Kafka. If Kafka does not acknowledge the message within this time period, the FlowFile will be routed to 'failure'.
Max Metadata Wait Time5 secThe amount of time publisher will wait to obtain metadata or wait for the buffer to flush during the 'send' call before failing the entire 'send' call. Corresponds to Kafka's 'max.block.ms' property
Supports Expression Language: true
Partitioner classorg.apache.kafka.cli ents.producer.internals.DefaultPartitioner
  • RoundRobinPartitioner Messages will be assigned partitions in a round-robin fashion, sending the first message to Partition 1, the next Partition to Partition 2, and so on, wrapping as necessary.
  • DefaultPartitioner Messages will be assigned to random partitions.
Specifies which class to use to compute a partition id for a message. Corresponds to Kafka's 'partitioner.class' property.
Compression Typenone
  • none
  • gzip
  • snappy
  • lz4
This parameter allows you to specify the compression codec for all data generated by this producer.

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.
NameValueDescription
The name of a Kafka configuration property.The value of a given Kafka configuration property.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.

Relationships:

NameDescription
successFlowFiles for which all content was sent to Kafka.
failureAny FlowFile that cannot be sent to Kafka will be routed to this Relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
msg.countThe number of messages that were sent to Kafka for this FlowFile. This attribute is added only to FlowFiles that are routed to success.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

See Also:

PublishKafka_0_10, ConsumeKafka_0_10, ConsumeKafkaRecord_0_10

\ No newline at end of file Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/additionalDetails.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/additionalDetails.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/additionalDetails.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/additionalDetails.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1,155 @@ + + + + + + PublishKafka + + + + + +

Description:

+

+ This Processor puts the contents of a FlowFile to a Topic in + Apache Kafka using KafkaProducer API available + with Kafka 0.10.x API. The content of a FlowFile becomes the contents of a Kafka message. + This message is optionally assigned a key by using the <Kafka Key> Property. +

+ +

+ The Processor allows the user to configure an optional Message Demarcator that + can be used to send many messages per FlowFile. For example, a \n could be used + to indicate that the contents of the FlowFile should be used to send one message + per line of text. It also supports multi-char demarcators (e.g., 'my custom demarcator'). + If the property is not set, the entire contents of the FlowFile + will be sent as a single message. When using the demarcator, if some messages are + successfully sent but other messages fail to send, the resulting FlowFile will be + considered a failed FlowFile and will have additional attributes to that effect. + One of such attributes is 'failed.last.idx' which indicates the index of the last message + that was successfully ACKed by Kafka. (if no demarcator is used the value of this index will be -1). + This will allow PublishKafka to only re-send un-ACKed messages on the next re-try. +

+

Security Configuration:

+

+ The Security Protocol property allows the user to specify the protocol for communicating + with the Kafka broker. The following sections describe each of the protocols in further detail. +

+

PLAINTEXT

+

+ This option provides an unsecured connection to the broker, with no client authentication and no encryption. + In order to use this option the broker must be configured with a listener of the form: +

+    PLAINTEXT://host.name:port
+            
+

+

SSL

+

+ This option provides an encrypted connection to the broker, with optional client authentication. In order + to use this option the broker must be configured with a listener of the form: +

+    SSL://host.name:port
+            
+ In addition, the processor must have an SSL Context Service selected. +

+

+ If the broker specifies ssl.client.auth=none, or does not specify ssl.client.auth, then the client will + not be required to present a certificate. In this case, the SSL Context Service selected may specify only + a truststore containing the public key of the certificate authority used to sign the broker's key. +

+

+ If the broker specifies ssl.client.auth=required then the client will be required to present a certificate. + In this case, the SSL Context Service must also specify a keystore containing a client key, in addition to + a truststore as described above. +

+

SASL_PLAINTEXT

+

+ This option uses SASL with a PLAINTEXT transport layer to authenticate to the broker. In order to use this + option the broker must be configured with a listener of the form: +

+    SASL_PLAINTEXT://host.name:port
+            
+ In addition, the Kerberos Service Name must be specified in the processor. +

+

SASL_PLAINTEXT - GSSAPI

+

+ If the SASL mechanism is GSSAPI, then the client must provide a JAAS configuration to authenticate. The + JAAS configuration can be provided by specifying the java.security.auth.login.config system property in + NiFi's bootstrap.conf, such as: +

+    java.arg.16=-Djava.security.auth.login.config=/path/to/kafka_client_jaas.conf
+            
+

+

+ An example of the JAAS config file would be the following: +

+    KafkaClient {
+        com.sun.security.auth.module.Krb5LoginModule required
+        useKeyTab=true
+        storeKey=true
+        keyTab="/path/to/nifi.keytab"
+        serviceName="kafka"
+        principal="nifi@YOURREALM.COM";
+    };
+            
+ NOTE: The serviceName in the JAAS file must match the Kerberos Service Name in the processor. +

+

+ Alternatively, starting with Apache NiFi 1.2.0 which uses the Kafka 0.10.2 client, the JAAS + configuration when using GSSAPI can be provided by specifying the Kerberos Principal and Kerberos Keytab + directly in the processor properties. This will dynamically create a JAAS configuration like above, and + will take precedence over the java.security.auth.login.config system property. +

+

SASL_PLAINTEXT - PLAIN

+

+ If the SASL mechanism is PLAIN, then client must provide a JAAS configuration to authenticate, but + the JAAS configuration must use Kafka's PlainLoginModule. An example of the JAAS config file would + be the following: +

+    KafkaClient {
+      org.apache.kafka.common.security.plain.PlainLoginModule required
+      username="nifi"
+      password="nifi-password";
+    };
+            
+

+

+ NOTE: It is not recommended to use a SASL mechanism of PLAIN with SASL_PLAINTEXT, as it would transmit + the username and password unencrypted. +

+

+ NOTE: Using the PlainLoginModule will cause it be registered in the JVM's static list of Providers, making + it visible to components in other NARs that may access the providers. There is currently a known issue + where Kafka processors using the PlainLoginModule will cause HDFS processors with Keberos to no longer work. +

+

SASL_SSL

+

+ This option uses SASL with an SSL/TLS transport layer to authenticate to the broker. In order to use this + option the broker must be configured with a listener of the form: +

+    SASL_SSL://host.name:port
+            
+

+

+ See the SASL_PLAINTEXT section for a description of how to provide the proper JAAS configuration + depending on the SASL mechanism (GSSAPI or PLAIN). +

+

+ See the SSL section for a description of how to configure the SSL Context Service based on the + ssl.client.auth property. +

+ + Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/index.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/index.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/index.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-10-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.PublishKafka_0_10/index.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1 @@ +PublishKafka_0_10

PublishKafka_0_10

Description:

Sends the contents of a FlowFile as a message to Apache Kafka using the Kafka 0.10.x Producer API.The messages to send may be individual FlowFiles or may be delimited, using a user-specified delimiter, such as a new-line. Please note there are cases where the publisher can get into an indefinite stuck state. We are closely monitoring how this evolves in the Kafka community and will take advantage of those fixes as soon as we can. In the meantime it is possible to enter states where the only resolution will be to restart the JVM NiFi runs on. Th e complementary NiFi processor for fetching messages is ConsumeKafka_0_10.

Additional Details...

Tags:

Apache, Kafka, Put, Send, Message, PubSub, 0.10.x

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Kafka Brokerslocalhost:9092A comma-separated list of known Kafka Brokers in the format <host>:<port>
Supports Expression Language: true
Sec urity ProtocolPLAINTEXT
  • PLAINTEXT PLAINTEXT
  • SSL SSL
  • SASL_PLAINTEXT SASL_PLAINTEXT
  • SASL_SSL SASL_SSL
Protocol used to communicate with brokers. Corresponds to Kafka's 'security.protocol' property.
Kerberos Service NameThe Kerberos principal name that Kafka runs as. 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 <Security Protocol> are selected.
Kerberos PrincipalThe 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.
Kerberos KeytabThe 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.
SSL Context ServiceController Service API:
SSLContextService
Impl ementations: StandardSSLContextService
StandardRestrictedSSLContextService
Specifies the SSL Context Service to use for communicating with Kafka.
Topic NameThe name of the Kafka Topic to publish to.
Supports Expression Language: true
Delivery Guarantee0
  • Best Effort FlowFile will be routed to success after successfully writing the content to a Kafka node, without waiting for a response. This provides 
 the best performance but may result in data loss.
  • Guarantee Single Node Delivery FlowFile will be routed to success if the message is received by a single Kafka node, whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> but can result in data loss if a Kafka node crashes
  • Guarantee Replicated Delivery FlowFile will be routed to failure unless the message is replicated to the approp
 riate number of Kafka Nodes according to the Topic configuration
Specifies the requirement for guaranteeing that a message is sent to Kafka. Corresponds to Kafka's 'acks' property.
Kafka KeyThe Key to use for the Message. If not specified, the flow file attribute 'kafka.key' is used as the message key, if it is present and we're not demarcating.
Supports Expression Language: true
Key Attribute Encodingutf-8
  • UTF-8 Encoded The key is interpreted as a UTF-8 Encoded string.
  • Hex Encoded The key is interpreted as arbitrary binary data that is encoded using hexadecimal characters with uppercase letters.
FlowFiles that are emitted have an attribute named 'kafka.key'. This property dictates how the value of the attribute should be encoded.
Message DemarcatorSpecifies the string (interpreted as UTF-8) to use for demarcating multiple messages within a single FlowFile. If not specified, the entire content of the FlowFile will be used as a single message. If specified, the contents of the FlowFile will be split on this delimiter and each section sent as a separate Kafka message. To en ter special character such as 'new line' use CTRL+Enter or Shift+Enter, depending on your OS.
Supports Expression Language: true
Max Request Size1 MBThe maximum size of a request in bytes. Corresponds to Kafka's 'max.request.size' property and defaults to 1 MB (1048576).
Acknowledgment Wait Time5 secsAfter sending a message to Kafka, this indicates the amount of time that we are willing to wait for a response from Kafka. If Kafka does not acknowledge the message within this time period, the FlowFile will be routed to 'failure'.
Max Metadata Wait Time5 secThe amount of time publisher will wait to obtain metadata or wait for the buffer to flush during the 'send' call before failing the entire 'send' call. Corresponds to Kafka's 'max.block.ms' property
Supports Expression Language: true
Partitioner classorg.apache.kafka.clients.producer.internals.DefaultPartitioner
  • RoundRobinPartitioner Messages will be assigned partitions in a round-robin fashion, sending the first message to Partition 1, the next Partition to Partition 2, and so on, wrapping as necessary.
  • DefaultPartitioner Messages will be assigned to random partitions.
Specifies which class to use to compute a partition id for a message. Corresponds to Kafka's 'partitioner.class' property.
Compression Typenone
  • none
  • gzip
  • snappy
  • lz4
This parameter allows you to specify the compression codec for all data generated by this producer.

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.
NameValueDescription
The name of a Kafka configuration property.The value of a given Kafka configuration property.These properties will be added on the Kafka configuration after loading any provided configuration properties. In the event a dyn amic 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.

Relationships:

NameDescription
successFlowFiles for which all content was sent to Kafka.
failureAny FlowFile that cannot be sent to Kafka will be routed to this Relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
msg.countThe number of messages that were sent to Kafka for this FlowFile. This attribute is added only to FlowFiles that are routed to success. If the <Message Demarcator> Property is not set, this will always be 1, but if the Property is set, it may be greater than 1.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship. \ No newline at end of file Added: nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-11-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafkaRecord_0_11/index.html URL: http://svn.apache.org/viewvc/nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-11-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafkaRecord_0_11/index.html?rev=1811008&view=auto ============================================================================== --- nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-11-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafkaRecord_0_11/index.html (added) +++ nifi/site/trunk/docs/nifi-docs/components/org.apache.nifi/nifi-kafka-0-11-nar/1.4.0/org.apache.nifi.processors.kafka.pubsub.ConsumeKafkaRecord_0_11/index.html Tue Oct 3 13:30:16 2017 @@ -0,0 +1 @@ +ConsumeKafkaRecord_0_11

ConsumeKafkaRecord_0_11

Description:

Consumes messages from Apache Kafka specifically built against the Kafka 0.11.x Consumer API. The complementary NiFi processor for sending messages is PublishKafkaRecord_0_11. Please note that, at this time, the Processor assumes that all records that are retrieved from a given partition have the same schema. If any of the Kafka messages are pulled but cannot be parsed or written with the configured Record Reader or Record Writer, the contents of the message will be written to a separate FlowFile, and that FlowFile will be transferred to the 'parse.failure' relationship. Otherwise, each FlowFile is sent to the 'success' relationship and may contain many individual messages within the single FlowFile. A 'record.count' attribute is added to indicate how many messages are contained in the FlowFile. No two Kafka messages will be placed into the same FlowFile if they have different schemas, or if they have different values for a message header that is included by the <Headers to Add as Attributes> property.

Tags:

Kafka, Get, Record, csv, avro, json, Ingest, Ingress, Topic, PubSub, Consume, 0.11.x

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Kafka Brokerslocalhost:9092A comma-separated list of known Kafka Brokers in the format <host>:<port>
Supports Expression Language: true
Topic Name(s)The name of the Kafka Topic(s) to pull from. More than one can be supplied if comma separated.
Supports Expression Language: true
Topic Name Formatnames
  • names Topic is a full topic name or comma separated list of names
  • pattern Topic is a regex using the Java Pattern syntax
Specifies whether the Topic(s) provided are a comma separated list of names or a single regular expression
Record ReaderController Service API:
RecordReaderFactory
Implementations: CSVReader
GrokReader
AvroReader
JsonTreeReader
JsonPathReader
ScriptedReader
The Record Reader to use for incoming FlowFiles
Record WriterController Service API:
RecordSetWriterFactory
Implementations: JsonRecordSetWriter
FreeFormTextRecordSetWriter
AvroR ecordSetWriter
ScriptedRecordSetWriter
CSVRecordSetWriter
The Record Writer to use in order to serialize the data before sending to Kafka
Honor Transactionstrue
  • true
  • false
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 tr ansaction 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.
Security ProtocolPLAINTEXT
  • PLAINTEXT PLAINTEXT
  • SSL SSL
  • SASL_PLAINTEXT SASL_PLAINTEXT
  • SASL_SSL SASL_SSL
Protocol used to communicate with brokers. Corresponds to Kafka's 'security.protocol' property.
Kerberos Service NameThe Kerberos principal name that Kafka runs as. 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 <Security Protocol> are selected.
Kerberos PrincipalThe 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.
Kerberos KeytabThe 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 s et into 'sasl.jaas.config' Kafka's property.
SSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
Specifies the SSL Context Service to use for communicating with Kafka.
Group IDA Group ID is used to identify consumers that are within the same consumer group. Corresponds to Kafka's 'group.id' property.
Offset Resetlatest
  • earliest Automatically reset the offset to the earliest offset
  • latest Automatically reset the offset to the latest offset
  • none Throw exception to the consumer if no previous offset is found for the consumer's group
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.
Message He ader EncodingUTF-8Any 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.
Headers to Add as Attributes (Regex)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, suc h as an identifier or timestamp, because it will prevent NiFi from bundling the messages together efficiently.
Max Poll Records10000Specifies the maximum number of records Kafka should return in a single poll.
Max Uncommitted Time1 secsSpecifies 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 t rack of in memory.

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.
NameValueDescription
The name of a Kafka configuration property.The value of a given Kafka configuration property.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.

Relationships:

NameDescription
successFlowFiles received from Kafka. Depending on demarcation strategy it is a flow file per message or a bundle of messages group ed by topic and partition.
parse.failureIf a message from Kafka cannot be parsed using the configured Record Reader, the contents of the message will be routed to this Relationship as its own individual FlowFile.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
record.countThe number of records received
mime.typeThe MIME Type that is provided by the configured Record Writer
kafka.partitionThe partition of the topic the records are from
kafka.topicThe topic records are from

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component does not allow an incoming relationship.

See Also:

ConsumeKafka_0_11, PublishKafka_0_11, PublishKafkaRecord_0_11

\ No newline at end of file