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, DELETE, OPTIONS and TRACE will result in an error and the HTTP response status code 405; CONNECT will also result in an error and the HTTP response status code 400. 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
http, https, ingest, listen, rest
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Base Path * | Base Path | contentListener | Base path for incoming connections Supports Expression Language, using Environment variables. | |
Listening Port * | Listening Port | The Port to listen on for incoming connections Supports Expression Language, using Environment variables. | ||
Listening Port for Health Check Requests | health-check-port | The 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, using Environment variables. | ||
Max Data to Receive per Second | Max Data to Receive per Second | The 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 Service | SSL Context Service | Controller Service: RestrictedSSLContextService Implementations: StandardRestrictedSSLContextService | SSL Context Service enables support for HTTPS | |
HTTP Protocols * | HTTP Protocols | http/1.1 |
| HTTP Protocols supported for Application Layer Protocol Negotiation with TLS This property is only considered if:
|
Client Authentication | client-authentication | AUTO |
| Client Authentication policy for TLS connections. Required when SSL Context Service configured. This property is only considered if:
|
Authorized Subject DN Pattern * | Authorized 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 Pattern | authorized-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 Time * | Max Unconfirmed Flowfile Time | 60 secs | The 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 | ||
Request Header Maximum Size * | Request Header Maximum Size | 8 KB | The maximum supported size of HTTP headers in requests sent to this processor | |
Return Code | Return Code | 200 | The HTTP return code returned after every HTTP call | |
Multipart Request Max Size * | multipart-request-max-size | 1 MB | The 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 Size * | multipart-read-buffer-size | 512 KB | The 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 Size * | max-thread-pool-size | 200 | The 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 Reader | record-reader | Controller Service: RecordReaderFactory Implementations: AvroReader CEFReader CSVReader ExcelReader GrokReader JsonPathReader JsonTreeReader ReaderLookup ScriptedReader Syslog5424Reader SyslogReader WindowsEventLogReader XMLReader YamlTreeReader | The Record Reader to use parsing the incoming FlowFile into Records | |
Record Writer * | record-writer | Controller Service: RecordSetWriterFactory Implementations: AvroRecordSetWriter CSVRecordSetWriter FreeFormTextRecordSetWriter JsonRecordSetWriter RecordSetWriterLookup ScriptedRecordSetWriter XMLRecordSetWriter | The Record Writer to use for serializing Records after they have been transformed This property is only considered if:
|
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
success | Relationship for successfully received FlowFiles |
Reads Attributes
This processor does not read attributes.
Writes Attributes
This processor does not write attributes.
State Management
This component does not store state.
Restricted
This component is not restricted.
Input Requirement
This component does not allow an incoming relationship.
Example Use Cases
Use Case 1
Unpack FlowFileV3 content received in a POST
POST requests with "Content-Type: application/flowfile-v3" will have their payload interpreted as FlowFileV3 format and will be automatically unpacked. This will output the original FlowFile(s) from within the FlowFileV3 format and will not require a separate UnpackContent processor.
Configuration
This feature of ListenHTTP is always on, no configuration required.
The MergeContent and PackageFlowFile processors can generate FlowFileV3 formatted data.
System Resource Considerations
This component does not specify system resource considerations.