ListenHTTP

Description:

Starts an HTTP Server and listens on a given base path to transform incoming requests into FlowFiles. The default URI of the Service will be http://{hostname}:{port}/contentListener. Only HEAD and POST requests are supported. GET, PUT, and DELETE will result in an error and the HTTP response status code 405. GET is supported on <service_URI>/healthcheck. If the service is available, it returns "200 OK" with the content "OK". The health check functionality can be configured to be accessible via a different port. For details see the documentation of the "Listening Port for health check requests" property.A Record Reader and Record Writer property can be enabled on the processor to process incoming requests as records. Record processing is not allowed for multipart requests and request in FlowFileV3 format (minifi).

Tags:

ingest, http, https, rest, listen

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Base PathBase PathcontentListenerBase path for incoming connections
Supports Expression Language: true (will be evaluated using variable registry only)
Listening PortListening PortThe Port to listen on for incoming connections
Supports Expression Language: true (will be evaluated using variable registry only)
Listening Port for Health Check Requestshealth-check-portThe port to listen on for incoming health check requests. If set, it must be different from the Listening Port. Configure this port if the processor is set to use two-way SSL and a load balancer that does not support client authentication for health check requests is used. Only /<base_path>/healthcheck service is available via this port and only GET and HEAD requests are supported. If the processor is set not to use SSL, SSL will not be used on this port, either. If the processor is set to use one-way SSL, one-way SSL will be used on this port. If the processor is set to use two-way SSL, one-way SSL will be used on this port (client authentication not required).
Supports Expression Language: true (will be evaluated using variable registry only)
Max Data to Receive per SecondMax Data to Receive per SecondThe maximum amount of data to receive per second; this allows the bandwidth to be throttled to a specified data rate; if not specified, the data rate is not throttled
SSL Context ServiceSSL Context ServiceController Service API:
RestrictedSSLContextService
Implementation: StandardRestrictedSSLContextService
SSL Context Service enables support for HTTPS
HTTP ProtocolsHTTP Protocolshttp/1.1
  • http/1.1 HTTP/1.1
  • h2 http/1.1 HTTP/2 and HTTP/1.1 negotiated based on requested protocols
  • h2 HTTP/2
HTTP Protocols supported for Application Layer Protocol Negotiation with TLS

This Property is only considered if the [SSL Context Service] Property has a value specified.
Client Authenticationclient-authenticationAUTO
  • AUTO Inferred based on SSL Context Service properties. The presence of Trust Store properties implies REQUIRED, otherwise NONE is configured.
  • WANT Requests the client certificate on handshake and validates if present but does not require it
  • REQUIRED Requests the client certificate on handshake and rejects the connection if it is not present and valid
  • NONE Does not request the client certificate on handshake
Client Authentication policy for TLS connections. Required when SSL Context Service configured.

This Property is only considered if the [SSL Context Service] Property has a value specified.
Authorized Subject DN PatternAuthorized DN Pattern.*A Regular Expression to apply against the Subject's Distinguished Name of incoming connections. If the Pattern does not match the Subject DN, the the processor will respond with a status of HTTP 403 Forbidden.
Authorized Issuer DN Patternauthorized-issuer-dn-pattern.*A Regular Expression to apply against the Issuer's Distinguished Name of incoming connections. If the Pattern does not match the Issuer DN, the processor will respond with a status of HTTP 403 Forbidden.
Max Unconfirmed Flowfile TimeMax Unconfirmed Flowfile Time60 secsThe maximum amount of time to wait for a FlowFile to be confirmed before it is removed from the cache
HTTP Headers to receive as Attributes (Regex)HTTP Headers to receive as Attributes (Regex)Specifies the Regular Expression that determines the names of HTTP Headers that should be passed along as FlowFile attributes
Return CodeReturn Code200The HTTP return code returned after every HTTP call
Multipart Request Max Sizemultipart-request-max-size1 MBThe max size of the request. Only applies for requests with Content-Type: multipart/form-data, and is used to prevent denial of service type of attacks, to prevent filling up the heap or disk space
Multipart Read Buffer Sizemultipart-read-buffer-size512 KBThe threshold size, at which the contents of an incoming file would be written to disk. Only applies for requests with Content-Type: multipart/form-data. It is used to prevent denial of service type of attacks, to prevent filling up the heap or disk space.
Maximum Thread Pool Sizemax-thread-pool-size200The maximum number of threads to be used by the embedded Jetty server. The value can be set between 8 and 1000. The value of this property affects the performance of the flows and the operating system, therefore the default value should only be changed in justified cases. A value that is less than the default value may be suitable if only a small number of HTTP clients connect to the server. A greater value may be suitable if a large number of HTTP clients are expected to make requests to the server simultaneously.
Record Readerrecord-readerController Service API:
RecordReaderFactory
Implementations: GrokReader
JsonTreeReader
WindowsEventLogReader
ReaderLookup
ParquetReader
CSVReader
Syslog5424Reader
ExcelReader
CEFReader
XMLReader
ScriptedReader
SyslogReader
JsonPathReader
AvroReader
YamlTreeReader
The Record Reader to use parsing the incoming FlowFile into Records
Record Writerrecord-writerController Service API:
RecordSetWriterFactory
Implementations: FreeFormTextRecordSetWriter
CSVRecordSetWriter
ParquetRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
JsonRecordSetWriter
AvroRecordSetWriter
The Record Writer to use for serializing Records after they have been transformed

This Property is only considered if the [Record Reader] Property has a value specified.

Relationships:

NameDescription
successRelationship for successfully received FlowFiles

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component does not allow an incoming relationship.

System Resource Considerations:

None specified.