Skip to main content

HandleHttpResponse

Description

Sends an HTTP Response to the Requestor that generated a FlowFile. This Processor is designed to be used in conjunction with the HandleHttpRequest in order to create a web service.

Tags

egress, http, https, response, web service

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 NameAPI NameDefault ValueAllowable ValuesDescription
HTTP Status Code *HTTP Status CodeThe HTTP Status Code to use when responding to the HTTP Request. See Section 10 of RFC 2616 for more information.

Supports Expression Language, using FlowFile attributes and Environment variables.
HTTP Context Map *HTTP Context MapController Service:
HttpContextMap

Implementations:
StandardHttpContextMap
The HTTP Context Map Controller Service to use for caching the HTTP Request Information
Attributes to add to the HTTP Response (Regex)Attributes to add to the HTTP Response (Regex)Specifies the Regular Expression that determines the names of FlowFile attributes that should be added to the HTTP response

Dynamic Properties

NameValueDescription
An HTTP header nameAn HTTP header valueThese HTTPHeaders are set in the HTTP Response

Supports Expression Language: Yes, evaluated using FlowFile Attributes and Environment variables.

Relationships

NameDescription
failureFlowFiles will be routed to this Relationship if the Processor is unable to respond to the requestor. This may happen, for instance, if the connection times out or if NiFi is restarted before responding to the HTTP Request.
successFlowFiles will be routed to this Relationship after the response has been successfully sent to the requestor

Reads Attributes

NameDescription
http.context.identifierThe value of this attribute is used to lookup the HTTP Response so that the proper message can be sent back to the requestor. If this attribute is missing, the FlowFile will be routed to 'failure.'
http.local.nameIP address/hostname of the server. Used for provenance event.
http.remote.hostIP address of the client. Used for provenance event.
http.request.uriValue of the URI requested by the client. Used for provenance event.
http.server.portListening port of the server. Used for provenance event.
http.subject.dnSSL distinguished name (if any). Used for provenance event.

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 requires an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also

StandardHttpContextMap, HandleHttpRequest