Allows configuring instances of
HttpServer.- Since:
- 0.12.0
-
Method Summary
Modifier and TypeMethodDescriptionconfigHttp1(Consumer<Http1ProtocolConfigurer> configCallback) Enables/disables and configures HTTP/1 specific parameters.configHttp2(Consumer<Http2ProtocolConfigurer> configCallback) Enables/disables and configures HTTP/2 specific parameters.setConnectionIdleTimeout(int connectionIdleTimeout) Defines the number of milliseconds that a connection can remain idle before being closed.Defines the host where the requests will be sent to theHttpServer.Sets a name to the resultingHttpServer.setPort(int port) Defines the port where the requests will be received by theHttpServer.setReadTimeout(long readTimeout) Defines the number of milliseconds that should be waited when reading new input.setSchedulerSupplier(Supplier<org.mule.runtime.api.scheduler.Scheduler> schedulerSupplier) setTlsContextFactory(org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory) Required exclusively for HTTPS, this defines through aTlsContextFactoryall the TLS related data to establish such connections.setUsePersistentConnections(boolean usePersistentConnections) Defines if connections should be kept after a request is completed or closed.
-
Method Details
-
setName
Sets a name to the resultingHttpServer.- Parameters:
name- the name.- Returns:
- this configurer
-
setHost
Defines the host where the requests will be sent to theHttpServer. Must be provided.- Parameters:
host- where to establish the server- Returns:
- this configurer
-
setPort
Defines the port where the requests will be received by theHttpServer. Must be provided.- Parameters:
port- where to listen- Returns:
- this configurer
-
setTlsContextFactory
HttpServerConfigurer setTlsContextFactory(org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory) Required exclusively for HTTPS, this defines through aTlsContextFactoryall the TLS related data to establish such connections. Set tonullby default.- Parameters:
tlsContextFactory- aTlsContextFactorywith the required data.- Returns:
- this configurer
-
setUsePersistentConnections
Defines if connections should be kept after a request is completed or closed. Default value istrue.- Parameters:
usePersistentConnections-booleanspecifying the decision- Returns:
- this configurer
-
setConnectionIdleTimeout
Defines the number of milliseconds that a connection can remain idle before being closed. Only relevant if persistent connections are used, the default value is 30 seconds.- Parameters:
connectionIdleTimeout- timeout value (in milliseconds)- Returns:
- this configurer
-
setSchedulerSupplier
HttpServerConfigurer setSchedulerSupplier(Supplier<org.mule.runtime.api.scheduler.Scheduler> schedulerSupplier) Defines aSupplierfor aSchedulerthat will be used by theHttpServerto process requests. Must be specified if the server isn't associated with a flow, where a processing strategy will define the scheduling.- Parameters:
schedulerSupplier- a supplier for the scheduler.- Returns:
- this configurer
-
setReadTimeout
Defines the number of milliseconds that should be waited when reading new input.- Parameters:
readTimeout- timeout value (in milliseconds)- Returns:
- this configurer
-
configHttp1
Enables/disables and configures HTTP/1 specific parameters.- Parameters:
configCallback- a callback that receives theHttp1ProtocolConfigurer.- Returns:
- this configurer
-
configHttp2
Enables/disables and configures HTTP/2 specific parameters.- Parameters:
configCallback- a callback that receives theHttp2ProtocolConfigurer.- Returns:
- this configurer
-