@CapabilityDescription(value="The PutTCP processor receives a FlowFile and transmits the FlowFile content over a TCP connection to the configured TCP server. By default, the FlowFiles are transmitted over the same TCP connection (or pool of TCP connections if multiple input threads are configured). To assist the TCP server with determining message boundaries, an optional \"Outgoing Message Delimiter\" string can be configured which is appended to the end of each FlowFiles content when it is transmitted over the TCP connection. An optional \"Connection Per FlowFile\" parameter can be specified to change the behaviour so that each FlowFiles content is transmitted over a single TCP connection which is opened when the FlowFile is received and closed after the FlowFile has been sent. This option should only be used for low message volume scenarios, otherwise the platform may run out of TCP sockets.") @InputRequirement(value=INPUT_REQUIRED) @SeeAlso(value=ListenTCP.class) @Tags(value={"remote","egress","put","tcp"}) @TriggerWhenEmpty public class PutTCP extends AbstractPutEventProcessor
The PutTCP processor receives a FlowFile and transmits the FlowFile content over a TCP connection to the configured TCP server. By default, the FlowFiles are transmitted over the same TCP connection (or pool of TCP connections if multiple input threads are configured). To assist the TCP server with determining message boundaries, an optional "Outgoing Message Delimiter" string can be configured which is appended to the end of each FlowFiles content when it is transmitted over the TCP connection. An optional "Connection Per FlowFile" parameter can be specified to change the behaviour so that each FlowFiles content is transmitted over a single TCP connection which is opened when the FlowFile is received and closed after the FlowFile has been sent. This option should only be used for low message volume scenarios, otherwise the platform may run out of TCP sockets.
This processor has the following required properties:
This processor has the following optional properties:
The following relationships are required:
AbstractPutEventProcessor.FlowFileMessageBatch, AbstractPutEventProcessor.RangeactiveBatches, CHARSET, completeBatches, CONNECTION_PER_FLOWFILE, HOSTNAME, IDLE_EXPIRATION, MAX_SOCKET_SEND_BUFFER_SIZE, MESSAGE_DELIMITER, OUTGOING_MESSAGE_DELIMITER, PORT, PROTOCOL, REL_FAILURE, REL_SUCCESS, senderPool, SSL_CONTEXT_SERVICE, TCP_VALUE, TIMEOUT, transitUri, UDP_VALUE| Constructor and Description |
|---|
PutTCP() |
| Modifier and Type | Method and Description |
|---|---|
protected ChannelSender |
createSender(ProcessContext context)
Creates a concrete instance of a ChannelSender object to use for sending messages over a TCP stream.
|
protected java.lang.String |
createTransitUri(ProcessContext context)
Creates a Universal Resource Identifier (URI) for this processor.
|
protected java.util.List<PropertyDescriptor> |
getAdditionalProperties()
Get the additional properties that are used by this processor.
|
protected boolean |
isConnectionPerFlowFile(ProcessContext context)
Gets the current value of the "Connection Per FlowFile" property.
|
protected void |
onFailure(ProcessContext context,
ProcessSession session,
FlowFile flowFile)
Event handler method to perform the required actions when a failure has occurred.
|
void |
onTrigger(ProcessContext context,
ProcessSessionFactory sessionFactory)
event handler method to handle the FlowFile being forwarded to the Processor by the framework.
|
acquireSender, closeSenders, createSender, getAdditionalRelationships, getOutgoingMessageDelimiter, getRelationships, getSupportedPropertyDescriptors, init, onScheduled, pruneIdleSenders, relinquishSendergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprotected ChannelSender createSender(ProcessContext context) throws java.io.IOException
createSender in class AbstractPutEventProcessorcontext - - the current process context.java.io.IOException - if an error occurs creating the ChannelSenderprotected java.lang.String createTransitUri(ProcessContext context)
createTransitUri in class AbstractPutEventProcessorcontext - - the current process context.protected java.util.List<PropertyDescriptor> getAdditionalProperties()
getAdditionalProperties in class AbstractPutEventProcessorpublic void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
context - - the current process context.sessionFactory - - a factory object to obtain a process session.ProcessException - if processing did not complete normally though
indicates the problem is an understood potential outcome of processing.
The controller/caller will handle these exceptions gracefully such as
logging, etc.. If another type of exception is allowed to propagate the
controller may no longer trigger this processor to operate, as this would
indicate a probable coding defect.protected void onFailure(ProcessContext context, ProcessSession session, FlowFile flowFile)
context - - the current process context.session - - the current process session.flowFile - - the FlowFile that has failed to have been processed.protected boolean isConnectionPerFlowFile(ProcessContext context)
context - - the current process context.