Class ListenUDPRecord
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processor.util.listen.AbstractListenEventProcessor<StandardEvent>
org.apache.nifi.processors.standard.ListenUDPRecord
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SupportsBatching
@Tags({"ingest","udp","listen","source","record"})
@InputRequirement(INPUT_FORBIDDEN)
@CapabilityDescription("Listens for Datagram Packets on a given port and reads the content of each datagram using the configured Record Reader. Each record will then be written to a flow file using the configured Record Writer. This processor can be restricted to listening for datagrams from a specific remote host and port by specifying the Sending Host and Sending Host Port properties, otherwise it will listen for datagrams from all hosts and ports.")
@WritesAttribute(attribute="udp.sender",description="The sending host of the messages.") @WritesAttribute(attribute="udp.port",description="The sending port the messages were received.") @WritesAttribute(attribute="record.count",description="The number of records written to the flow file.") @WritesAttribute(attribute="mime.type",description="The mime-type of the writer used to write the records to the flow file.")
public class ListenUDPRecord
extends AbstractListenEventProcessor<StandardEvent>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classHolder class to pass around a flow file and the writer that is writing records to it.private static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<org.apache.nifi.components.PropertyDescriptor> private static final List<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate longstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final StringFields inherited from class org.apache.nifi.processor.util.listen.AbstractListenEventProcessor
charset, CHARSET, descriptors, dispatcher, errorEvents, events, MAX_MESSAGE_QUEUE_SIZE, MAX_SOCKET_BUFFER_SIZE, POLL_TIMEOUT_MS, port, PORT, RECV_BUFFER_SIZE, REL_SUCCESS, relationships -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ChannelDispatchercreateDispatcher(org.apache.nifi.processor.ProcessContext context, BlockingQueue<StandardEvent> events) protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) protected List<org.apache.nifi.components.PropertyDescriptor> protected List<org.apache.nifi.processor.Relationship> getAttributes(String sender) protected longprivate StringgetTransitUri(String sender) private voidhandleParseFailure(StandardEvent event, org.apache.nifi.processor.ProcessSession session, Exception cause) private voidhandleParseFailure(StandardEvent event, org.apache.nifi.processor.ProcessSession session, Exception cause, String message) voidonScheduled(org.apache.nifi.processor.ProcessContext context) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.util.listen.AbstractListenEventProcessor
closeDispatcher, getDispatcherPort, getErrorQueueSize, getListeningPort, getMessage, getQueueSize, getRelationships, getSupportedPropertyDescriptors, initMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
SENDING_HOST
public static final org.apache.nifi.components.PropertyDescriptor SENDING_HOST -
SENDING_HOST_PORT
public static final org.apache.nifi.components.PropertyDescriptor SENDING_HOST_PORT -
RECORD_READER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_READER -
RECORD_WRITER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER -
POLL_TIMEOUT
public static final org.apache.nifi.components.PropertyDescriptor POLL_TIMEOUT -
BATCH_SIZE
public static final org.apache.nifi.components.PropertyDescriptor BATCH_SIZE -
ADDITIONAL_PROPERTIES
-
REL_PARSE_FAILURE
public static final org.apache.nifi.processor.Relationship REL_PARSE_FAILURE -
ADDITIONAL_RELATIONSHIPS
-
UDP_PORT_ATTR
- See Also:
-
UDP_SENDER_ATTR
- See Also:
-
RECORD_COUNT_ATTR
- See Also:
-
pollTimeout
private volatile long pollTimeout
-
-
Constructor Details
-
ListenUDPRecord
public ListenUDPRecord()
-
-
Method Details
-
getAdditionalProperties
- Overrides:
getAdditionalPropertiesin classAbstractListenEventProcessor<StandardEvent>
-
getAdditionalRelationships
- Overrides:
getAdditionalRelationshipsin classAbstractListenEventProcessor<StandardEvent>
-
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) throws IOException - Overrides:
onScheduledin classAbstractListenEventProcessor<StandardEvent>- Throws:
IOException
-
getLongPollTimeout
protected long getLongPollTimeout()- Overrides:
getLongPollTimeoutin classAbstractListenEventProcessor<StandardEvent>
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
createDispatcher
protected ChannelDispatcher createDispatcher(org.apache.nifi.processor.ProcessContext context, BlockingQueue<StandardEvent> events) throws IOException - Specified by:
createDispatcherin classAbstractListenEventProcessor<StandardEvent>- Throws:
IOException
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
handleParseFailure
private void handleParseFailure(StandardEvent event, org.apache.nifi.processor.ProcessSession session, Exception cause) -
handleParseFailure
private void handleParseFailure(StandardEvent event, org.apache.nifi.processor.ProcessSession session, Exception cause, String message) -
getAttributes
-
getTransitUri
-