@SupportsBatching @InputRequirement(value=INPUT_FORBIDDEN) @Tags(value={"listen","tcp","tls","ssl"}) @CapabilityDescription(value="Listens for incoming TCP connections and reads data from each connection using a line separator as the message demarcator. The default behavior is for each message to produce a single FlowFile, however this can be controlled by increasing the Batch Size to a larger value for higher throughput. The Receive Buffer Size must be set as large as the largest messages expected to be received, meaning if every 100kb there is a line separator, then the Receive Buffer Size must be greater than 100kb.") @WritesAttribute(attribute="tcp.sender",description="The sending host of the messages.") @WritesAttribute(attribute="tcp.port",description="The sending port the messages were received.") public class ListenTCP extends AbstractListenEventBatchingProcessor<StandardEvent>
AbstractListenEventBatchingProcessor.FlowFileEventBatch
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
CLIENT_AUTH |
static PropertyDescriptor |
SSL_CONTEXT_SERVICE |
MAX_BATCH_SIZE, MESSAGE_DELIMITER, messageDemarcatorBytes
charset, CHARSET, descriptors, dispatcher, errorEvents, events, MAX_CONNECTIONS, MAX_MESSAGE_QUEUE_SIZE, MAX_SOCKET_BUFFER_SIZE, POLL_TIMEOUT_MS, port, PORT, RECV_BUFFER_SIZE, REL_SUCCESS, relationships
Constructor and Description |
---|
ListenTCP() |
Modifier and Type | Method and Description |
---|---|
protected ChannelDispatcher |
createDispatcher(ProcessContext context,
java.util.concurrent.BlockingQueue<StandardEvent> events) |
protected java.util.Collection<ValidationResult> |
customValidate(ValidationContext validationContext)
Allows subclasses to perform their own validation on the already set
properties.
|
protected java.util.List<PropertyDescriptor> |
getAdditionalProperties()
Override to provide additional properties for the processor.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getAttributes(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
Creates the attributes for the FlowFile of the given batch.
|
protected java.lang.String |
getTransitUri(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
Creates the transit uri to be used when reporting a provenance receive event for the given batch.
|
getBatches, getBatchKey, init, onScheduled, onTrigger, postProcess
createBufferPool, getAdditionalRelationships, getDispatcherPort, getErrorQueueSize, getLongPollTimeout, getMessage, getQueueSize, getRelationships, getSupportedPropertyDescriptors, onUnscheduled
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final PropertyDescriptor SSL_CONTEXT_SERVICE
public static final PropertyDescriptor CLIENT_AUTH
protected java.util.List<PropertyDescriptor> getAdditionalProperties()
AbstractListenEventProcessor
getAdditionalProperties
in class AbstractListenEventProcessor<StandardEvent>
protected java.util.Collection<ValidationResult> customValidate(ValidationContext validationContext)
AbstractConfigurableComponent
customValidate
in class AbstractConfigurableComponent
validationContext
- provides a mechanism for obtaining externally
managed values, such as property values and supplies convenience methods
for operating on those valuesprotected ChannelDispatcher createDispatcher(ProcessContext context, java.util.concurrent.BlockingQueue<StandardEvent> events) throws java.io.IOException
createDispatcher
in class AbstractListenEventProcessor<StandardEvent>
context
- the ProcessContext to retrieve property values fromjava.io.IOException
- if unable to listen on the requested portprotected java.util.Map<java.lang.String,java.lang.String> getAttributes(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
AbstractListenEventBatchingProcessor
getAttributes
in class AbstractListenEventBatchingProcessor<StandardEvent>
batch
- the current batchprotected java.lang.String getTransitUri(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
AbstractListenEventBatchingProcessor
getTransitUri
in class AbstractListenEventBatchingProcessor<StandardEvent>
batch
- the current batch