PutKafka

Description:

Sends the contents of a FlowFile as a message to Apache Kafka, specifically for 0.8.x versions. The messages to send may be individual FlowFiles or may be delimited, using a user-specified delimiter, such as a new-line. The complementary NiFi processor for fetching messages is GetKafka.

Additional Details...

Tags:

Apache, Kafka, Put, Send, Message, PubSub, 0.8.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
Known BrokersA comma-separated list of known Kafka Brokers in the format <host>:<port>
Supports Expression Language: true (will be evaluated using variable registry only)
Topic NameThe Kafka Topic of interest
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
PartitionSpecifies which Kafka Partition to add the message to. If using a message delimiter, all messages in the same FlowFile will be sent to the same partition. If a partition is specified but is not valid, then the FlowFile will be routed to failure relationship.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Kafka KeyThe Key to use for the Message
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
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 appropriate number of Kafka Nodes according to the Topic configuration
Specifies the requirement for guaranteeing that a message is sent to Kafka
Message DelimiterSpecifies the delimiter (interpreted in its UTF-8 byte representation) to use for splitting apart 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. Note that if messages are delimited and some messages for a given FlowFile are transferred successfully while others are not, the messages will be split into individual FlowFiles, such that those messages that were successfully sent are routed to the 'success' relationship while other messages are sent to the 'failure' relationship.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Max Buffer Size5 MBThe maximum amount of data to buffer in memory before sending to Kafka
Max Record Size1 MBThe maximum size that any individual record can be.
Communications Timeout30 secsThe amount of time to wait for a response from Kafka before determining that there is a communications error
Batch Size16384This configuration controls the default batch size in bytes.The producer will attempt to batch records together into fewer requests whenever multiple records are being sent to the same partition. This helps performance on both the client and the server.
Queue Buffering Max TimeMaximum time to buffer data before sending to Kafka. For example a setting of 100 ms will try to batch together 100 milliseconds' worth of messages to send at once. This will improve throughput but adds message delivery latency due to the buffering.
Compression Codecnone
  • None Compression will not be used for any topic.
  • GZIP Compress messages using GZIP
  • Snappy Compress messages using Snappy
This parameter allows you to specify the compression codec for all data generated by this producer.
Client NameClient Name to use when communicating with Kafka

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 as part of the static properties, its value wil be overriden with warning message describing the override. For the list of available Kafka properties please refer to: http://kafka.apache.org/documentation.html#configuration.
Supports Expression Language: false

Relationships:

NameDescription
successAny FlowFile that is successfully sent to Kafka will be routed to this Relationship
failureAny FlowFile that cannot be sent to Kafka will be routed to this Relationship

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.