[
https://issues.apache.org/jira/browse/NIFI-14378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17936576#comment-17936576
]
David Handermann commented on NIFI-14378:
-----------------------------------------
Thanks for proposing this new Processor and providing some implementation
details [~ireh].
On initial read, a generic socket Processor does not seem like a good fit the
project. Networking protocols are defined for specific use cases, so any socket
communication should either build on an existing protocol, or define strong
reasons for a proprietary socket protocol.
NiFi has had some custom socket protocol capabilities, but maintaining them
introduces a lot of complexity. For this reason, it is much better to build on
a well-defined protocol that has the capabilities desired.
With this background, I recommend describing the desired capabilities for
network communication, and then evaluating available networking protocols,
rather than building something completely new.
> New Processor: Socket Client Processor for Sending and Receiving Data
> ---------------------------------------------------------------------
>
> Key: NIFI-14378
> URL: https://issues.apache.org/jira/browse/NIFI-14378
> Project: Apache NiFi
> Issue Type: New Feature
> Components: Extensions
> Affects Versions: 2.3.0
> Reporter: HamidReza Ireh
> Assignee: HamidReza Ireh
> Priority: Major
> Labels: FeatureRequest, Processor, SocketClient, networking
>
> A new processor is requested that acts as a Socket Client, allowing users to
> send data to a server over a socket connection and receive responses. The
> processor should be configurable to support different use cases, including
> sending input data from a FlowFile and handling responses from the server.
> *Features & Requirements*
> The processor should:
> # *Establish a connection* to a configurable server and port.
> # *Send input data* (if any) from the FlowFile content or attributes to the
> server.
> # {*}Receive response data{*}, if applicable, and route it to the success
> relationship.
> # *Support configurable options* such as:
> ** Hostname/IP and Port
> ** Connection Timeout and Read Timeout
> ** Socket Type (TCP/UDP)
> ** Encoding (UTF-8, ASCII, etc.)
> ** Request and Response handling (Delimited messages, raw streams, etc.)
> ** Retry mechanism and error handling
> # {*}Handle different response scenarios{*}, such as:
> No response required (fire-and-forget)
> Read response until a delimiter
> Read response of a fixed size
> # *Support dynamic properties* to allow flexible configurations based on use
> cases.
> # *Be compatible with NiFi 2.x* and follow the best practices for NiFi
> processor development.
> *Use Cases*
> * Connecting to external TCP/UDP servers for real-time data exchange.
> * Integrating with legacy systems that require socket-based communication.
> * Sending real-time commands and receiving responses in a flow-based
> architecture.
> *Alternatives Considered*
> Currently, users may use ExecuteScript or custom processors to achieve
> similar functionality, but a dedicated Socket Client Processor would provide
> a more streamlined and configurable solution.
> *Additional Notes*
> This processor can be similar in concept to InvokeHTTP but designed for raw
> socket communication.
> Proper exception handling and logging should be implemented to ensure
> reliable operation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)