@SupportsBatching @Tags(value={"ingest","udp","listen","source","record"}) @InputRequirement(value=INPUT_FORBIDDEN) @CapabilityDescription(value="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>
| Modifier and Type | Class and Description |
|---|---|
private static class |
ListenUDPRecord.FlowFileRecordWriter
Holder class to pass around a flow file and the writer that is writing records to it.
|
private static class |
ListenUDPRecord.HostValidator |
| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
BATCH_SIZE |
static PropertyDescriptor |
POLL_TIMEOUT |
private long |
pollTimeout |
static String |
RECORD_COUNT_ATTR |
static PropertyDescriptor |
RECORD_READER |
static PropertyDescriptor |
RECORD_WRITER |
static Relationship |
REL_PARSE_FAILURE |
static PropertyDescriptor |
SENDING_HOST |
static PropertyDescriptor |
SENDING_HOST_PORT |
static String |
UDP_PORT_ATTR |
static String |
UDP_SENDER_ATTR |
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 and Description |
|---|
ListenUDPRecord() |
| Modifier and Type | Method and Description |
|---|---|
protected ChannelDispatcher |
createDispatcher(ProcessContext context,
BlockingQueue<StandardEvent> events) |
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
protected List<PropertyDescriptor> |
getAdditionalProperties() |
protected List<Relationship> |
getAdditionalRelationships() |
private Map<String,String> |
getAttributes(String sender) |
protected long |
getLongPollTimeout() |
private String |
getTransitUri(String sender) |
private void |
handleParseFailure(StandardEvent event,
ProcessSession session,
Exception cause) |
private void |
handleParseFailure(StandardEvent event,
ProcessSession session,
Exception cause,
String message) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
closeDispatcher, getDispatcherPort, getErrorQueueSize, getListeningPort, getMessage, getQueueSize, getRelationships, getSupportedPropertyDescriptors, initonTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor SENDING_HOST
public static final PropertyDescriptor SENDING_HOST_PORT
public static final PropertyDescriptor RECORD_READER
public static final PropertyDescriptor RECORD_WRITER
public static final PropertyDescriptor POLL_TIMEOUT
public static final PropertyDescriptor BATCH_SIZE
public static final Relationship REL_PARSE_FAILURE
public static final String UDP_PORT_ATTR
public static final String UDP_SENDER_ATTR
public static final String RECORD_COUNT_ATTR
private volatile long pollTimeout
protected List<PropertyDescriptor> getAdditionalProperties()
getAdditionalProperties in class AbstractListenEventProcessor<StandardEvent>protected List<Relationship> getAdditionalRelationships()
getAdditionalRelationships in class AbstractListenEventProcessor<StandardEvent>@OnScheduled public void onScheduled(ProcessContext context) throws IOException
onScheduled in class AbstractListenEventProcessor<StandardEvent>IOExceptionprotected long getLongPollTimeout()
getLongPollTimeout in class AbstractListenEventProcessor<StandardEvent>protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentprotected ChannelDispatcher createDispatcher(ProcessContext context, BlockingQueue<StandardEvent> events) throws IOException
createDispatcher in class AbstractListenEventProcessor<StandardEvent>IOExceptionpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprivate void handleParseFailure(StandardEvent event, ProcessSession session, Exception cause)
private void handleParseFailure(StandardEvent event, ProcessSession session, Exception cause, String message)
Copyright © 2023 Apache NiFi Project. All rights reserved.