Class HttpExt
- All Implemented Interfaces:
- org.apache.pekko.actor.Extension
 Use as Http().bindAndHandle etc. with an implicit ActorSystem in scope.
- 
Constructor SummaryConstructorsConstructorDescriptionHttpExt(com.typesafe.config.Config config, org.apache.pekko.actor.ExtendedActorSystem system) 
- 
Method SummaryModifier and TypeMethodDescriptionscala.concurrent.Future<Http.ServerBinding>bindAndHandleAsyncImpl(scala.Function1<HttpRequest, scala.concurrent.Future<HttpResponse>> handler, String interface_, int port, ConnectionContext connectionContext, ServerSettings settings, int parallelism, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) scala.concurrent.Future<Http.ServerBinding>bindAndHandleImpl(org.apache.pekko.stream.scaladsl.Flow<HttpRequest, HttpResponse, Object> handler, String interface_, int port, ConnectionContext connectionContext, ServerSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) Convenience method which starts a new HTTP server at the given endpoint and uses the givenhandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.org.apache.pekko.stream.scaladsl.Source<Http.IncomingConnection,scala.concurrent.Future<Http.ServerBinding>> bindImpl(String interface_, int port, ConnectionContext connectionContext, ServerSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates apekko.stream.scaladsl.Sourceofpekko.http.scaladsl.Http.IncomingConnectioninstances which represents a prospective HTTP server binding on the givenendpoint.<T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, scala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> cachedHostConnectionPool(String host, int port, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Returns apekko.stream.scaladsl.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.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, scala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> cachedHostConnectionPoolHttps(String host, int port, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Same ascachedHostConnectionPool(java.lang.String, int, org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings, org.apache.pekko.event.LoggingAdapter)but for encrypted (HTTPS) connections.org.apache.pekko.stream.scaladsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> clientLayer(Host hostHeader) Constructs apekko.http.scaladsl.Http.ClientLayerstage using the configured defaultpekko.http.scaladsl.settings.ClientConnectionSettings, configured using thepekko.http.clientconfig section.org.apache.pekko.stream.scaladsl.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 apekko.http.scaladsl.Http.ClientLayerstage using the givenpekko.http.scaladsl.settings.ClientConnectionSettings.connectionTo(String host) Creates a builder which will create a single connection to a host every time the built flow is materialized.Gets the current default client-sideHttpsConnectionContext.<T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, scala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> newHostConnectionPool(String host, int port, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) Starts a new connection pool to the given host and configuration and returns apekko.stream.scaladsl.Flowwhich dispatches the requests from all its materializations across this pool.<T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, scala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> newHostConnectionPool(HostConnectionPoolSetup setup, org.apache.pekko.stream.Materializer fm) INTERNAL API<T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, scala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> newHostConnectionPoolHttps(String host, int port, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) Same asnewHostConnectionPool(java.lang.String, int, org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings, org.apache.pekko.event.LoggingAdapter, org.apache.pekko.stream.Materializer)but for encrypted (HTTPS) connections.newServerAt(String interface_, int port) Main entry point to create a server binding.org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse, scala.concurrent.Future<Http.OutgoingConnection>> outgoingConnection(String host, int port, scala.Option<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates apekko.stream.scaladsl.Flowrepresenting a prospective HTTP client connection to the given endpoint.org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse, scala.concurrent.Future<Http.OutgoingConnection>> outgoingConnectionHttps(String host, int port, HttpsConnectionContext connectionContext, scala.Option<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Same asoutgoingConnection(java.lang.String, int, scala.Option<java.net.InetSocketAddress>, org.apache.pekko.http.scaladsl.settings.ClientConnectionSettings, org.apache.pekko.event.LoggingAdapter)but for encrypted (HTTPS) connections.org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse, scala.concurrent.Future<Http.OutgoingConnection>> outgoingConnectionUsingContext(String host, int port, ConnectionContext connectionContext, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Similar tooutgoingConnectionbut allows to specify a user-defined context to run the connection on.scala.concurrent.Future<Object>poolSize()INTERNAL APIorg.apache.pekko.stream.scaladsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> serverLayer(ServerSettings settings, scala.Option<InetSocketAddress> remoteAddress, org.apache.pekko.event.LoggingAdapter log, boolean isSecureConnection) Constructs apekko.http.scaladsl.Http.ServerLayerstage using the givenpekko.http.scaladsl.settings.ServerSettings.voidSets the default client-sideHttpsConnectionContext.scala.concurrent.Future<scala.runtime.BoxedUnit>Triggers an orderly shutdown of all host connections pools currently maintained by thepekko.actor.ActorSystem.scala.concurrent.Future<HttpResponse>singleRequest(HttpRequest request, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Fires a singlepekko.http.scaladsl.model.HttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.<T> scala.Tuple2<scala.concurrent.Future<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.scaladsl.Flow<Message, Message, T> clientFlow, ConnectionContext connectionContext, scala.Option<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer mat) Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.org.apache.pekko.stream.scaladsl.BidiFlow<org.apache.pekko.stream.TLSProtocol.SslTlsOutbound,org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, org.apache.pekko.NotUsed> sslTlsClientStage(ConnectionContext connectionContext, String host, int port) Creates real or placebo SslTls stage based on if ConnectionContext is HTTPS or not.org.apache.pekko.stream.scaladsl.BidiFlow<org.apache.pekko.stream.TLSProtocol.SslTlsOutbound,org.apache.pekko.util.ByteString, org.apache.pekko.util.ByteString, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, org.apache.pekko.NotUsed> sslTlsServerStage(ConnectionContext connectionContext) <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, scala.Tuple2<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> superPool(HttpsConnectionContext connectionContext, 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.org.apache.pekko.actor.ExtendedActorSystemsystem()org.apache.pekko.stream.scaladsl.Flow<Message,Message, scala.concurrent.Future<WebSocketUpgradeResponse>> webSocketClientFlow(WebSocketRequest request, ConnectionContext connectionContext, scala.Option<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.scaladsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, scala.concurrent.Future<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs apekko.http.scaladsl.Http.WebSocketClientLayerstage using the configured defaultpekko.http.scaladsl.settings.ClientConnectionSettings, configured using thepekko.http.clientconfig section.
- 
Constructor Details- 
HttpExtpublic HttpExt(com.typesafe.config.Config config, org.apache.pekko.actor.ExtendedActorSystem system) 
 
- 
- 
Method Details- 
bindAndHandleAsyncImplpublic scala.concurrent.Future<Http.ServerBinding> bindAndHandleAsyncImpl(scala.Function1<HttpRequest, scala.concurrent.Future<HttpResponse>> handler, String interface_, int port, ConnectionContext connectionContext, ServerSettings settings, int parallelism, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) 
- 
bindAndHandleImplpublic scala.concurrent.Future<Http.ServerBinding> bindAndHandleImpl(org.apache.pekko.stream.scaladsl.Flow<HttpRequest, HttpResponse, Object> handler, String interface_, int port, ConnectionContext connectionContext, ServerSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) Convenience method which starts a new HTTP server at the given endpoint and uses the givenhandlerpekko.stream.scaladsl.Flowfor processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the pekko.http.server.max-connectionssetting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.To configure additional settings for a server started using this method, use the pekko.http.serverconfig section or pass in apekko.http.scaladsl.settings.ServerSettingsexplicitly.- Parameters:
- handler- (undocumented)
- interface_- (undocumented)
- port- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- fm- (undocumented)
- Returns:
- (undocumented)
 
- 
bindImplpublic org.apache.pekko.stream.scaladsl.Source<Http.IncomingConnection,scala.concurrent.Future<Http.ServerBinding>> bindImpl(String interface_, int port, ConnectionContext connectionContext, ServerSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates apekko.stream.scaladsl.Sourceofpekko.http.scaladsl.Http.IncomingConnectioninstances which represents a prospective HTTP server binding on the givenendpoint.If the given port is 0 the resulting source can be materialized several times. Each materialization will then be assigned a new local port by the operating system, which can then be retrieved by the materialized pekko.http.scaladsl.Http.ServerBinding.If the given port is non-zero subsequent materialization attempts of the produced source will immediately fail, unless the first materialization has already been unbound. Unbinding can be triggered via the materialized pekko.http.scaladsl.Http.ServerBinding.If an ConnectionContextis given it will be used for setting up TLS encryption on the binding. Otherwise the binding will be unencrypted.If no portis explicitly given (or the port value is negative) the protocol's default port will be used, which is 80 for HTTP and 443 for HTTPS.To configure additional settings for a server started using this method, use the pekko.http.serverconfig section or pass in apekko.http.scaladsl.settings.ServerSettingsexplicitly.- Parameters:
- interface_- (undocumented)
- port- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolpublic <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, cachedHostConnectionPoolscala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> (String host, int port, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Returns apekko.stream.scaladsl.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.scaladsl.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:
- host- (undocumented)
- port- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
cachedHostConnectionPoolHttpspublic <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, cachedHostConnectionPoolHttpsscala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> (String host, int port, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Same ascachedHostConnectionPool(java.lang.String, int, org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings, org.apache.pekko.event.LoggingAdapter)but for encrypted (HTTPS) connections.If an explicit ConnectionContextis given then it rather than the configured defaultConnectionContextwill be used for encryption on the connections.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:
- host- (undocumented)
- port- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
clientLayerpublic org.apache.pekko.stream.scaladsl.BidiFlow<HttpRequest,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, clientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpResponse, org.apache.pekko.NotUsed> (Host hostHeader) Constructs apekko.http.scaladsl.Http.ClientLayerstage using the configured defaultpekko.http.scaladsl.settings.ClientConnectionSettings, configured using thepekko.http.clientconfig section.- Parameters:
- hostHeader- (undocumented)
- Returns:
- (undocumented)
 
- 
clientLayerpublic org.apache.pekko.stream.scaladsl.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 apekko.http.scaladsl.Http.ClientLayerstage using the givenpekko.http.scaladsl.settings.ClientConnectionSettings.- Parameters:
- hostHeader- (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, Future[OutgoingConnection}.
 
- 
dateHeaderRendering
- 
defaultClientHttpsContextGets the current default client-sideHttpsConnectionContext. Defaults used here can be configured using ssl-config or the context can be replaced usingsetDefaultClientHttpsContext(org.apache.pekko.http.scaladsl.HttpsConnectionContext)- Returns:
- (undocumented)
 
- 
newHostConnectionPoolpublic <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, newHostConnectionPoolscala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> (String host, int port, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) Starts a new connection pool to the given host and configuration and returns apekko.stream.scaladsl.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.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:
- host- (undocumented)
- port- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- fm- (undocumented)
- Returns:
- (undocumented)
 
- 
newHostConnectionPoolpublic <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, newHostConnectionPoolscala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> (HostConnectionPoolSetup setup, org.apache.pekko.stream.Materializer fm) INTERNAL API- Parameters:
- setup- (undocumented)
- fm- (undocumented)
- Returns:
- (undocumented)
 
- 
newHostConnectionPoolHttpspublic <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, newHostConnectionPoolHttpsscala.Tuple2<scala.util.Try<HttpResponse>, T>, Http.HostConnectionPool> (String host, int port, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer fm) Same asnewHostConnectionPool(java.lang.String, int, org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings, org.apache.pekko.event.LoggingAdapter, org.apache.pekko.stream.Materializer)but for encrypted (HTTPS) connections.If an explicit ConnectionContextis given then it rather than the configured defaultConnectionContextwill be used for encryption on the connections.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:
- host- (undocumented)
- port- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- fm- (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)
 
- 
outgoingConnectionpublic org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse, outgoingConnectionscala.concurrent.Future<Http.OutgoingConnection>> (String host, int port, scala.Option<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Creates apekko.stream.scaladsl.Flowrepresenting a prospective HTTP client connection to the given endpoint. Every materialization of the produced flow will attempt to establish a new outgoing connection.To configure additional settings for requests made using this method, use the pekko.http.clientconfig section or pass in apekko.http.scaladsl.settings.ClientConnectionSettingsexplicitly.Prefer connectionTo(java.lang.String)over this method.- Parameters:
- host- (undocumented)
- port- (undocumented)
- localAddress- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
outgoingConnectionHttpspublic org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse, outgoingConnectionHttpsscala.concurrent.Future<Http.OutgoingConnection>> (String host, int port, HttpsConnectionContext connectionContext, scala.Option<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Same asoutgoingConnection(java.lang.String, int, scala.Option<java.net.InetSocketAddress>, org.apache.pekko.http.scaladsl.settings.ClientConnectionSettings, org.apache.pekko.event.LoggingAdapter)but for encrypted (HTTPS) connections.If an explicit HttpsConnectionContextis given then it rather than the configured defaultHttpsConnectionContextwill be used for encryption on the connection.To configure additional settings for requests made using this method, use the pekko.http.clientconfig section or pass in apekko.http.scaladsl.settings.ClientConnectionSettingsexplicitly.Prefer connectionTo(java.lang.String)over this method.- Parameters:
- host- (undocumented)
- port- (undocumented)
- connectionContext- (undocumented)
- localAddress- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
outgoingConnectionUsingContextpublic org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse, outgoingConnectionUsingContextscala.concurrent.Future<Http.OutgoingConnection>> (String host, int port, ConnectionContext connectionContext, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Similar tooutgoingConnectionbut allows to specify a user-defined context to run the connection on.Depending on the kind of ConnectionContextthe implementation will add TLS between the given transport and the HTTP implementationTo configure additional settings for requests made using this method, use the pekko.http.clientconfig section or pass in apekko.http.scaladsl.settings.ClientConnectionSettingsexplicitly.Prefer connectionTo(java.lang.String)over this method.- Parameters:
- host- (undocumented)
- port- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
poolMaster
- 
poolSizeINTERNAL APIFor testing only - Returns:
- (undocumented)
 
- 
serverLayerpublic org.apache.pekko.stream.scaladsl.BidiFlow<HttpResponse,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, serverLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, HttpRequest, org.apache.pekko.NotUsed> (ServerSettings settings, scala.Option<InetSocketAddress> remoteAddress, org.apache.pekko.event.LoggingAdapter log, boolean isSecureConnection) Constructs apekko.http.scaladsl.Http.ServerLayerstage using the givenpekko.http.scaladsl.settings.ServerSettings. The returnedpekko.stream.scaladsl.BidiFlowisn't reusable and can only be materialized once.- Parameters:
- settings- (undocumented)
- remoteAddress- (undocumented)
- log- (undocumented)
- isSecureConnection- (undocumented)
- Returns:
- (undocumented)
 
- 
setDefaultClientHttpsContextSets the default client-sideHttpsConnectionContext.- Parameters:
- context- (undocumented)
 
- 
shutdownAllConnectionPoolspublic scala.concurrent.Future<scala.runtime.BoxedUnit> shutdownAllConnectionPools()Triggers 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)
 
- 
singleRequestpublic scala.concurrent.Future<HttpResponse> singleRequest(HttpRequest request, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, org.apache.pekko.event.LoggingAdapter log) Fires a singlepekko.http.scaladsl.model.HttpRequestacross the (cached) host connection pool for the request's effective URI to produce a response future.If an explicit ConnectionContextis given then it rather than the configured defaultConnectionContextwill be used for setting up the HTTPS connection pool, if the request is targeted towards anhttpsendpoint.Note that the request must have an absolute URI, otherwise the future will be completed with an error. - Parameters:
- request- (undocumented)
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
singleWebSocketRequestpublic <T> scala.Tuple2<scala.concurrent.Future<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, org.apache.pekko.stream.scaladsl.Flow<Message, Message, T> clientFlow, ConnectionContext connectionContext, scala.Option<InetSocketAddress> localAddress, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log, org.apache.pekko.stream.Materializer mat) 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)
- mat- (undocumented)
- Returns:
- (undocumented)
 
- 
sslTlsClientStagepublic org.apache.pekko.stream.scaladsl.BidiFlow<org.apache.pekko.stream.TLSProtocol.SslTlsOutbound,org.apache.pekko.util.ByteString, sslTlsClientStageorg.apache.pekko.util.ByteString, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, org.apache.pekko.NotUsed> (ConnectionContext connectionContext, String host, int port) Creates real or placebo SslTls stage based on if ConnectionContext is HTTPS or not.
- 
sslTlsServerStagepublic org.apache.pekko.stream.scaladsl.BidiFlow<org.apache.pekko.stream.TLSProtocol.SslTlsOutbound,org.apache.pekko.util.ByteString, sslTlsServerStageorg.apache.pekko.util.ByteString, org.apache.pekko.stream.TLSProtocol.SslTlsInbound, org.apache.pekko.NotUsed> (ConnectionContext connectionContext) 
- 
superPoolpublic <T> org.apache.pekko.stream.scaladsl.Flow<scala.Tuple2<HttpRequest,T>, superPoolscala.Tuple2<scala.util.Try<HttpResponse>, T>, org.apache.pekko.NotUsed> (HttpsConnectionContext connectionContext, 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 an absolute URI.If an explicit ConnectionContextis given then it rather than the configured defaultConnectionContextwill be used for setting up HTTPS connection pools, if required.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:
- connectionContext- (undocumented)
- settings- (undocumented)
- log- (undocumented)
- Returns:
- (undocumented)
 
- 
systempublic org.apache.pekko.actor.ExtendedActorSystem system()
- 
webSocketClientFlowpublic org.apache.pekko.stream.scaladsl.Flow<Message,Message, webSocketClientFlowscala.concurrent.Future<WebSocketUpgradeResponse>> (WebSocketRequest request, ConnectionContext connectionContext, scala.Option<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)
 
- 
webSocketClientLayerpublic org.apache.pekko.stream.scaladsl.BidiFlow<Message,org.apache.pekko.stream.TLSProtocol.SslTlsOutbound, webSocketClientLayerorg.apache.pekko.stream.TLSProtocol.SslTlsInbound, Message, scala.concurrent.Future<WebSocketUpgradeResponse>> (WebSocketRequest request, ClientConnectionSettings settings, org.apache.pekko.event.LoggingAdapter log) Constructs apekko.http.scaladsl.Http.WebSocketClientLayerstage using the configured defaultpekko.http.scaladsl.settings.ClientConnectionSettings, 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)
 
 
-