@InputRequirement(value=INPUT_FORBIDDEN) @Tags(value={"ingest","http","https","rest","listen"}) @CapabilityDescription(value="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).") public class ListenHTTP extends AbstractSessionFactoryProcessor
| Modifier and Type | Class and Description |
|---|---|
static class |
ListenHTTP.ClientAuthentication |
static class |
ListenHTTP.FlowFileEntryTimeWrapper |
| Constructor and Description |
|---|
ListenHTTP() |
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateprivate static final String MATCH_ALL
private final AtomicBoolean initialized
private final AtomicBoolean runOnPrimary
public static final Relationship RELATIONSHIP_SUCCESS
public static final PropertyDescriptor BASE_PATH
public static final PropertyDescriptor PORT
public static final PropertyDescriptor HEALTH_CHECK_PORT
public static final PropertyDescriptor AUTHORIZED_DN_PATTERN
public static final PropertyDescriptor AUTHORIZED_ISSUER_DN_PATTERN
public static final PropertyDescriptor MAX_UNCONFIRMED_TIME
public static final PropertyDescriptor MAX_DATA_RATE
public static final PropertyDescriptor SSL_CONTEXT_SERVICE
public static final PropertyDescriptor HTTP_PROTOCOL_STRATEGY
public static final PropertyDescriptor HEADERS_AS_ATTRIBUTES_REGEX
public static final PropertyDescriptor RETURN_CODE
public static final PropertyDescriptor MULTIPART_REQUEST_MAX_SIZE
public static final PropertyDescriptor MULTIPART_READ_BUFFER_SIZE
public static final PropertyDescriptor CLIENT_AUTHENTICATION
public static final PropertyDescriptor MAX_THREAD_POOL_SIZE
public static final PropertyDescriptor RECORD_READER
public static final PropertyDescriptor RECORD_WRITER
protected static final List<PropertyDescriptor> PROPERTIES
private static final Set<Relationship> RELATIONSHIPS
public static final String CONTEXT_ATTRIBUTE_PROCESSOR
public static final String CONTEXT_ATTRIBUTE_LOGGER
public static final String CONTEXT_ATTRIBUTE_SESSION_FACTORY_HOLDER
public static final String CONTEXT_ATTRIBUTE_PROCESS_CONTEXT_HOLDER
public static final String CONTEXT_ATTRIBUTE_AUTHORITY_PATTERN
public static final String CONTEXT_ATTRIBUTE_AUTHORITY_ISSUER_PATTERN
public static final String CONTEXT_ATTRIBUTE_HEADER_PATTERN
public static final String CONTEXT_ATTRIBUTE_FLOWFILE_MAP
public static final String CONTEXT_ATTRIBUTE_STREAM_THROTTLER
public static final String CONTEXT_ATTRIBUTE_BASE_PATH
public static final String CONTEXT_ATTRIBUTE_RETURN_CODE
public static final String CONTEXT_ATTRIBUTE_MULTIPART_REQUEST_MAX_SIZE
public static final String CONTEXT_ATTRIBUTE_MULTIPART_READ_BUFFER_SIZE
public static final String CONTEXT_ATTRIBUTE_PORT
private volatile org.eclipse.jetty.server.Server server
private final ConcurrentMap<String,ListenHTTP.FlowFileEntryTimeWrapper> flowFileMap
private final AtomicReference<ProcessSessionFactory> sessionFactoryReference
private final AtomicReference<StreamThrottler> throttlerRef
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentprivate void validatePortsAreNotEqual(ValidationContext context, Collection<ValidationResult> validationResults)
private ValidationResult createValidationResult(String subject, String explanation)
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnStopped public void shutdownHttpServer()
org.eclipse.jetty.server.Server getServer()
private void shutdownHttpServer(org.eclipse.jetty.server.Server toShutdown)
private void createHttpServerFromService(ProcessContext context) throws Exception
Exceptionprivate ListenHTTP.ClientAuthentication getClientAuthentication(SSLContextService sslContextService, PropertyValue clientAuthenticationProperty)
private org.eclipse.jetty.server.ServerConnector createServerConnector(org.eclipse.jetty.server.Server server,
int port,
SSLContextService sslContextService,
ListenHTTP.ClientAuthentication clientAuthentication,
HttpProtocolStrategy httpProtocolStrategy)
@OnScheduled public void clearInit()
private Set<String> findOldFlowFileIds(ProcessContext ctx)
public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
ProcessException@OnPrimaryNodeStateChange public void onPrimaryNodeChange(PrimaryNodeState newState)
Copyright © 2023 Apache NiFi Project. All rights reserved.