@CapabilityDescription(value="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.") @Tags(value={"Kafka","Get","Ingest","Ingress","Topic","PubSub","Consume","1.0"}) @WritesAttribute(attribute="kafka.count",description="The number of messages written if more than one") @WritesAttribute(attribute="kafka.key",description="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.") @WritesAttribute(attribute="kafka.offset",description="The offset of the message in the partition of the topic.") @WritesAttribute(attribute="kafka.timestamp",description="The timestamp of the message in the partition of the topic.") @WritesAttribute(attribute="kafka.partition",description="The partition of the topic the message or message bundle is from") @WritesAttribute(attribute="kafka.topic",description="The topic the message or message bundle is from") @InputRequirement(value=INPUT_FORBIDDEN) @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 ConsumeKafka_1_0 extends AbstractProcessor
| Constructor and Description |
|---|
ConsumeKafka_1_0() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected ConsumerPool |
createConsumerPool(ProcessContext context,
ComponentLog log) |
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
private ConsumerPool |
getConsumerPool(ProcessContext context) |
Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
interruptActiveThreads() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatestatic final AllowableValue OFFSET_EARLIEST
static final AllowableValue OFFSET_LATEST
static final AllowableValue OFFSET_NONE
static final AllowableValue TOPIC_NAME
static final AllowableValue TOPIC_PATTERN
static final PropertyDescriptor TOPICS
static final PropertyDescriptor TOPIC_TYPE
static final PropertyDescriptor GROUP_ID
static final PropertyDescriptor AUTO_OFFSET_RESET
static final PropertyDescriptor KEY_ATTRIBUTE_ENCODING
static final PropertyDescriptor MESSAGE_DEMARCATOR
static final PropertyDescriptor HEADER_NAME_REGEX
static final PropertyDescriptor MAX_POLL_RECORDS
static final PropertyDescriptor MAX_UNCOMMITTED_TIME
static final PropertyDescriptor HONOR_TRANSACTIONS
static final PropertyDescriptor MESSAGE_HEADER_ENCODING
static final Relationship REL_SUCCESS
static final List<PropertyDescriptor> DESCRIPTORS
static final Set<Relationship> RELATIONSHIPS
private volatile ConsumerPool consumerPool
private final Set<ConsumerLease> activeLeases
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnStopped public void close()
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor in class AbstractConfigurableComponentprotected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentprivate ConsumerPool getConsumerPool(ProcessContext context)
protected ConsumerPool createConsumerPool(ProcessContext context, ComponentLog log)
@OnUnscheduled public void interruptActiveThreads()
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionCopyright © 2022 Apache NiFi Project. All rights reserved.