Class Http
- All Implemented Interfaces:
- org.apache.pekko.actor.Extension
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Tapply(org.apache.pekko.actor.ActorSystem system) static Tapply(org.apache.pekko.actor.ClassicActorSystemProvider system) <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> Returns apekko.stream.javadsl.Flowwhich dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> Returns apekko.stream.javadsl.Flowwhich dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> cachedHostConnectionPool(ConnectHttp to, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Returns apekko.stream.javadsl.Flowwhich dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> Same as<T>cachedHostConnectionPool(java.lang.String)but with HTTPS encryption.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> cachedHostConnectionPoolHttps(ConnectHttp to, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Same as<T>cachedHostConnectionPool(java.lang.String)but with HTTPS encryption.org.apache.pekko.stream.javadsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> clientLayer(Host hostHeader) Constructs a client layer stage using the configured defaultpekko.http.javadsl.settings.ClientConnectionSettings.org.apache.pekko.stream.javadsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> clientLayer(Host hostHeader, ClientConnectionSettings settings) Constructs a client layer stage using the givenpekko.http.javadsl.settings.ClientConnectionSettings.org.apache.pekko.stream.javadsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> clientLayer(Host hostHeader, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs a client layer stage using the givenClientConnectionSettings.connectionTo(String host) Creates a builder which will create a single connection to a host every time the built flow is materialized.static HttpcreateExtension(org.apache.pekko.actor.ExtendedActorSystem system) Gets the current default client-sideConnectionContext.static final booleanstatic Httpget(org.apache.pekko.actor.ActorSystem system) static Httpget(org.apache.pekko.actor.ClassicActorSystemProvider system) static final inthashCode()static Http$lookup()<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> newHostConnectionPool(String host, org.apache.pekko.stream.Materializer materializer) Starts a new connection pool to the given host and configuration and returns apekko.stream.javadsl.Flowwhich dispatches the requests from all its materializations across this pool.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> newHostConnectionPool(ConnectHttp to, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer materializer) Same as<T>newHostConnectionPool(java.lang.String,org.apache.pekko.stream.Materializer)but with HTTPS encryption.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> newHostConnectionPool(ConnectHttp to, org.apache.pekko.stream.Materializer materializer) Starts a new connection pool to the given host and configuration and returns apekko.stream.javadsl.Flowwhich dispatches the requests from all its materializations across this pool.newServerAt(String interface_, int port) Main entry point to create a server binding.org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse, CompletionStage<OutgoingConnection>> outgoingConnection(String host) Creates apekko.stream.javadsl.Flowrepresenting a prospective HTTP client connection to the given endpoint.org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse, CompletionStage<OutgoingConnection>> Creates apekko.stream.javadsl.Flowrepresenting a prospective HTTP client connection to the given endpoint.org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse, CompletionStage<OutgoingConnection>> outgoingConnection(ConnectHttp to, Optional<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates apekko.stream.javadsl.Flowrepresenting a prospective HTTP client connection to the given endpoint.org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> Constructs a server layer stage using the configured defaultpekko.http.javadsl.settings.ServerSettings.org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> serverLayer(ServerSettings settings) Constructs a server layer stage using the givenpekko.http.javadsl.settings.ServerSettings.org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> serverLayer(ServerSettings settings, Optional<InetSocketAddress> remoteAddress) Constructs a server layer stage using the givenpekko.http.javadsl.settings.ServerSettings.org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> serverLayer(ServerSettings settings, Optional<InetSocketAddress> remoteAddress, org.apache.pekko.event.LoggingAdapter log) Constructs a server layer stage using the givenServerSettings.voidSets the default client-sideConnectionContext.CompletionStage<scala.runtime.BoxedUnit>Triggers an orderly shutdown of all host connections pools currently maintained by thepekko.actor.ActorSystem.singleRequest(HttpRequest request) Fires a singleHttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.singleRequest(HttpRequest request, HttpsConnectionContext connectionContext) Fires a singleHttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.singleRequest(HttpRequest request, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Fires a singleHttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.<T> org.apache.pekko.japi.Pair<CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.javadsl.Flow<Message, Message, T> clientFlow, ConnectionContext connectionContext, Optional<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer materializer) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.<T> org.apache.pekko.japi.Pair<CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.javadsl.Flow<Message, Message, T> clientFlow, ConnectionContext connectionContext, org.apache.pekko.stream.Materializer materializer) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.<T> org.apache.pekko.japi.Pair<CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.javadsl.Flow<Message, Message, T> clientFlow, org.apache.pekko.stream.Materializer materializer) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> superPool(ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.<T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> superPool(ConnectionPoolSettings settings, HttpsConnectionContext connectionContext, org.apache.pekko.event.LoggingAdapter log) Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.org.apache.pekko.stream.javadsl.Flow<Message,Message, CompletionStage<WebSocketUpgradeResponse>> webSocketClientFlow(WebSocketRequest request) Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.org.apache.pekko.stream.javadsl.Flow<Message,Message, CompletionStage<WebSocketUpgradeResponse>> webSocketClientFlow(WebSocketRequest request, ConnectionContext connectionContext, Optional<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.org.apache.pekko.stream.javadsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, CompletionStage<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request) Constructs a WebSocketpekko.stream.javadsl.BidiFlow.org.apache.pekko.stream.javadsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, CompletionStage<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings) Constructs a WebSocketpekko.stream.javadsl.BidiFlowusing the configured defaultClientConnectionSettings, configured using thepekko.http.clientconfig section.org.apache.pekko.stream.javadsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, CompletionStage<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs a WebSocketpekko.stream.javadsl.BidiFlowusing the configured defaultClientConnectionSettings, configured using thepekko.http.clientconfig section.
- 
Constructor Details- 
Httppublic Http(org.apache.pekko.actor.ExtendedActorSystem system) 
 
- 
- 
Method Details- 
get
- 
get
- 
lookup
- 
createExtension
- 
applypublic static T apply(org.apache.pekko.actor.ActorSystem system) 
- 
applypublic static T apply(org.apache.pekko.actor.ClassicActorSystemProvider system) 
- 
hashCodepublic static final int hashCode()
- 
equals
- 
serverLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, serverLayer()org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> Constructs a server layer stage using the configured defaultpekko.http.javadsl.settings.ServerSettings. The returnedpekko.stream.javadsl.BidiFlowisn't reusable and can only be materialized once.- Returns:
- (undocumented)
 
- 
serverLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, serverLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> (ServerSettings settings) Constructs a server layer stage using the givenpekko.http.javadsl.settings.ServerSettings. The returnedpekko.stream.javadsl.BidiFlowisn't reusable and can only be materialized once.- Parameters:
- settings- (undocumented)
- Returns:
- (undocumented)
 
- 
serverLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, serverLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> (ServerSettings settings, Optional<InetSocketAddress> remoteAddress) Constructs a server layer stage using the givenpekko.http.javadsl.settings.ServerSettings. The returnedpekko.stream.javadsl.BidiFlowisn't reusable and can only be materialized once.- Parameters:
- settings- (undocumented)
- remoteAddress- (undocumented)
- Returns:
- (undocumented)
 
- 
serverLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, serverLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> (ServerSettings settings, Optional<InetSocketAddress> remoteAddress, org.apache.pekko.event.LoggingAdapter log) Constructs a server layer stage using the givenServerSettings. The returnedpekko.stream.javadsl.BidiFlowisn't reusable and can only be materialized once.- Parameters:
- settings- (undocumented)
- remoteAddress- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
newServerAtMain entry point to create a server binding.- Parameters:
- interface- The interface to bind to.
- port- The port to bind to or- 0if the port should be automatically assigned.
- interface_- (undocumented)
- Returns:
- (undocumented)
 
- 
clientLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, clientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> (Host hostHeader) Constructs a client layer stage using the configured defaultpekko.http.javadsl.settings.ClientConnectionSettings.- Parameters:
- hostHeader- (undocumented)
- Returns:
- (undocumented)
 
- 
clientLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, clientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> (Host hostHeader, ClientConnectionSettings settings) Constructs a client layer stage using the givenpekko.http.javadsl.settings.ClientConnectionSettings.- Parameters:
- hostHeader- (undocumented)
- settings- (undocumented)
- Returns:
- (undocumented)
 
- 
clientLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, clientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> (Host hostHeader, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs a client layer stage using the givenClientConnectionSettings.- Parameters:
- hostHeader- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
outgoingConnectionpublic org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse, outgoingConnectionCompletionStage<OutgoingConnection>> (String host) Creates apekko.stream.javadsl.Flowrepresenting a prospective HTTP client connection to the given endpoint. Every materialization of the produced flow will attempt to establish a new outgoing connection.If the hostname is given with an https://prefix, the defaultHttpsConnectionContextwill be used.Prefer connectionTo(java.lang.String)over this method.- Parameters:
- host- (undocumented)
- Returns:
- (undocumented)
 
- 
outgoingConnectionpublic org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse, outgoingConnectionCompletionStage<OutgoingConnection>> (ConnectHttp to) Creates apekko.stream.javadsl.Flowrepresenting a prospective HTTP client connection to the given endpoint. Every materialization of the produced flow will attempt to establish a new outgoing connection.Use the ConnectHttpDSL to configure target host and whether HTTPS should be used.Prefer connectionTo(java.lang.String)over this method.- Parameters:
- to- (undocumented)
- Returns:
- (undocumented)
 
- 
outgoingConnectionpublic org.apache.pekko.stream.javadsl.Flow<HttpRequest,HttpResponse, outgoingConnectionCompletionStage<OutgoingConnection>> (ConnectHttp to, Optional<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates apekko.stream.javadsl.Flowrepresenting a prospective HTTP client connection to the given endpoint. Every materialization of the produced flow will attempt to establish a new outgoing connection.Prefer connectionTo(java.lang.String)over this method.- Parameters:
- to- (undocumented)
- localAddress- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
connectionToCreates a builder which will create a single connection to a host every time the built flow is materialized. There is no pooling and you are yourself responsible for lifecycle management of the connection. For a more convenient Request level API seesingleRequest()- Parameters:
- host- (undocumented)
- Returns:
- A builder to configure more specific setup for the connection and then build a Flow>Request, Response, CompletionStage>OutgoingConnection>>.
 
- 
newHostConnectionPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, newHostConnectionPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (String host, org.apache.pekko.stream.Materializer materializer) Starts a new connection pool to the given host and configuration and returns apekko.stream.javadsl.Flowwhich dispatches the requests from all its materializations across this pool. While the started host connection pool internally shuts itself down automatically after the configured idle timeout it will spin itself up again if more requests arrive from an existing or a new client flow materialization. The returned flow therefore remains usable for the full lifetime of the application.Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.- Parameters:
- host- (undocumented)
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
newHostConnectionPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, newHostConnectionPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (ConnectHttp to, org.apache.pekko.stream.Materializer materializer) Starts a new connection pool to the given host and configuration and returns apekko.stream.javadsl.Flowwhich dispatches the requests from all its materializations across this pool. While the started host connection pool internally shuts itself down automatically after the configured idle timeout it will spin itself up again if more requests arrive from an existing or a new client flow materialization. The returned flow therefore remains usable for the full lifetime of the application.Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.- Parameters:
- to- (undocumented)
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
newHostConnectionPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, newHostConnectionPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (ConnectHttp to, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer materializer) Same as<T>newHostConnectionPool(java.lang.String,org.apache.pekko.stream.Materializer)but with HTTPS encryption.The given ConnectionContextwill be used for encryption on the connection.- Parameters:
- to- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, cachedHostConnectionPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (String host) Returns apekko.stream.javadsl.Flowwhich dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returnedpekko.stream.javadsl.Flowinstances therefore remain valid throughout the lifetime of the application.The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem). Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.- Parameters:
- host- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, cachedHostConnectionPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (ConnectHttp to) Returns apekko.stream.javadsl.Flowwhich dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returnedpekko.stream.javadsl.Flowinstances therefore remain valid throughout the lifetime of the application.The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem). Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.- Parameters:
- to- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, cachedHostConnectionPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (ConnectHttp to, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Returns apekko.stream.javadsl.Flowwhich dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returnedpekko.stream.javadsl.Flowinstances therefore remain valid throughout the lifetime of the application.The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem). Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.To configure additional settings for the pool (and requests made using it), use the pekko.http.host-connection-poolconfig section or pass in aConnectionPoolSettingsexplicitly.- Parameters:
- to- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolHttpspublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, cachedHostConnectionPoolHttpsorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (ConnectHttp to, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Same as<T>cachedHostConnectionPool(java.lang.String)but with HTTPS encryption.When an HttpConnectionContextis defined in the givenConnectHttpit will be used, otherwise the default client-side context will be used.- Parameters:
- to- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolHttpspublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, cachedHostConnectionPoolHttpsorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, HostConnectionPool> (ConnectHttp to) Same as<T>cachedHostConnectionPool(java.lang.String)but with HTTPS encryption.When an HttpConnectionContextis defined in the givenConnectHttpit will be used, otherwise the default client-side context will be used.- Parameters:
- to- (undocumented)
- Returns:
- (undocumented)
 
- 
superPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, superPool()org.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs. Note that incoming requests must have either an absolute URI or a validHostheader.Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests AandBenter the flow in that order the response forBmight be produced before the response forA. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of typeTfrom the application which is emitted together with the corresponding response.- Returns:
- (undocumented)
 
- 
superPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, superPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> (ConnectionPoolSettings settings, HttpsConnectionContext connectionContext, org.apache.pekko.event.LoggingAdapter log) Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs. Note that incoming requests must have either an absolute URI or a validHostheader.The given HttpsConnectionContextis used to configure TLS for the connection.Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests AandBenter theflowin that order the response forBmight be produced before the response forA.In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.- Parameters:
- settings- (undocumented)
- connectionContext- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
superPoolpublic <T> org.apache.pekko.stream.javadsl.Flow<org.apache.pekko.japi.Pair<HttpRequest,T>, superPoolorg.apache.pekko.japi.Pair<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> (ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs. Note that incoming requests must have either an absolute URI or a validHostheader.The defaultClientHttpsContext()is used to configure TLS for the connection.Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests AandBenter theflowin that order the response forBmight be produced before the response forA.In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type Tfrom the application which is emitted together with the corresponding response.- Parameters:
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
singleRequestFires a singleHttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.The defaultClientHttpsContext()is used to configure TLS for the connection.Note that the request must have either an absolute URI or a valid Hostheader, otherwise the future will be completed with an error.- Parameters:
- request- (undocumented)
- Returns:
- (undocumented)
 
- 
singleRequestpublic CompletionStage<HttpResponse> singleRequest(HttpRequest request, HttpsConnectionContext connectionContext) Fires a singleHttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.The defaultClientHttpsContext()is used to configure TLS for the connection.Note that the request must have either an absolute URI or a valid Hostheader, otherwise the future will be completed with an error.- Parameters:
- request- (undocumented)
- connectionContext- (undocumented)
- Returns:
- (undocumented)
 
- 
singleRequestpublic CompletionStage<HttpResponse> singleRequest(HttpRequest request, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Fires a singleHttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.The given HttpsConnectionContextwill be used for encryption if the request is sent to an https endpoint.Note that the request must have either an absolute URI or a valid Hostheader, otherwise the future will be completed with an error.- Parameters:
- request- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
webSocketClientLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, webSocketClientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, CompletionStage<WebSocketUpgradeResponse>> (WebSocketRequest request) Constructs a WebSocketpekko.stream.javadsl.BidiFlow.The layer is not reusable and must only be materialized once. - Parameters:
- request- (undocumented)
- Returns:
- (undocumented)
 
- 
webSocketClientLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, webSocketClientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, CompletionStage<WebSocketUpgradeResponse>> (WebSocketRequest request, ClientConnectionSettings settings) Constructs a WebSocketpekko.stream.javadsl.BidiFlowusing the configured defaultClientConnectionSettings, configured using thepekko.http.clientconfig section.The layer is not reusable and must only be materialized once. - Parameters:
- request- (undocumented)
- settings- (undocumented)
- Returns:
- (undocumented)
 
- 
webSocketClientLayerpublic org.apache.pekko.stream.javadsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, webSocketClientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, CompletionStage<WebSocketUpgradeResponse>> (WebSocketRequest request, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs a WebSocketpekko.stream.javadsl.BidiFlowusing the configured defaultClientConnectionSettings, configured using thepekko.http.clientconfig section.The layer is not reusable and must only be materialized once. - Parameters:
- request- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
webSocketClientFlowpublic org.apache.pekko.stream.javadsl.Flow<Message,Message, webSocketClientFlowCompletionStage<WebSocketUpgradeResponse>> (WebSocketRequest request) Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.The layer is not reusable and must only be materialized once. - Parameters:
- request- (undocumented)
- Returns:
- (undocumented)
 
- 
webSocketClientFlowpublic org.apache.pekko.stream.javadsl.Flow<Message,Message, webSocketClientFlowCompletionStage<WebSocketUpgradeResponse>> (WebSocketRequest request, ConnectionContext connectionContext, Optional<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.The layer is not reusable and must only be materialized once. - Parameters:
- request- (undocumented)
- connectionContext- (undocumented)
- localAddress- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
singleWebSocketRequestpublic <T> org.apache.pekko.japi.Pair<CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.javadsl.Flow<Message, Message, T> clientFlow, org.apache.pekko.stream.Materializer materializer) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.The defaultClientHttpsContext()is used to configure TLS for the connection.- Parameters:
- request- (undocumented)
- clientFlow- (undocumented)
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
singleWebSocketRequestpublic <T> org.apache.pekko.japi.Pair<CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.javadsl.Flow<Message, Message, T> clientFlow, ConnectionContext connectionContext, org.apache.pekko.stream.Materializer materializer) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.The defaultClientHttpsContext()is used to configure TLS for the connection.- Parameters:
- request- (undocumented)
- clientFlow- (undocumented)
- connectionContext- (undocumented)
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
singleWebSocketRequestpublic <T> org.apache.pekko.japi.Pair<CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.javadsl.Flow<Message, Message, T> clientFlow, ConnectionContext connectionContext, Optional<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer materializer) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.- Parameters:
- request- (undocumented)
- clientFlow- (undocumented)
- connectionContext- (undocumented)
- localAddress- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- materializer- (undocumented)
- Returns:
- (undocumented)
 
- 
shutdownAllConnectionPoolsTriggers an orderly shutdown of all host connections pools currently maintained by thepekko.actor.ActorSystem. The returned future is completed when all pools that were live at the time of this method call have completed their shutdown process.If existing pool client flows are re-used or new ones materialized concurrently with or after this method call the respective connection pools will be restarted and not contribute to the returned future. - Returns:
- (undocumented)
 
- 
defaultClientHttpsContextGets the current default client-sideConnectionContext.- Returns:
- (undocumented)
 
- 
setDefaultClientHttpsContextSets the default client-sideConnectionContext.- Parameters:
- context- (undocumented)
 
 
-