Class JettyHttpTransportBuilder
JettyHttpTransport.
Obtain an instance via JettyHttpTransport.builder().
See Also:
- Since:
- 9.2.1
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns theJettyHttpTransport.httpClient(org.eclipse.jetty.client.HttpClient value) Sets the underlyingHttpClientto use.responseTimeoutMs(long value) Sets the maximum time to wait for the response headers to arrive after the request is sent.
-
Method Details
-
httpClient
Sets the underlyingHttpClientto use.If not set, a default client is created via
new HttpClient().If the provided client has not been started,
JettyHttpTransportwill start it automatically. WhenJettyHttpTransport.close()is called, the client will be stopped.The client itself is not changed. So that a redirect it follows does not carry caller-set credential headers to another origin, the transport creates each request itself, as a guarded subclass of Jetty's request, instead of calling
HttpClient.newRequest(java.net.URI); an override of that method is not called. Customize requests with the client's own settings and request listeners instead.- Parameters:
value- The client to use. Must not benull .- Returns:
- This object.
-
responseTimeoutMs
Sets the maximum time to wait for the response headers to arrive after the request is sent.This timeout covers the time from when the request is fully sent until the first response line and headers are received. It does not limit how long the response body may take to stream. Defaults to
30_000ms (30 seconds).- Parameters:
value- The timeout in milliseconds. Use0or a negative value to wait indefinitely.- Returns:
- This object.
-
build
Builds and returns theJettyHttpTransport.- Returns:
- A new instance. Never
null . - Throws:
Exception- If the JettyHttpClientcannot be started.
-