Class Http
- java.lang.Object
-
- akka.http.javadsl.Http
-
- All Implemented Interfaces:
akka.actor.Extension
public class Http extends java.lang.Object implements akka.actor.Extension
-
-
Constructor Summary
Constructors Constructor Description Http(akka.actor.ExtendedActorSystem system)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static T
apply(akka.actor.ActorSystem system)
static T
apply(akka.actor.ClassicActorSystemProvider system)
akka.stream.javadsl.Source<IncomingConnection,java.util.concurrent.CompletionStage<ServerBinding>>
bind(ConnectHttp connect)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).connectionSource() insteadakka.stream.javadsl.Source<IncomingConnection,java.util.concurrent.CompletionStage<ServerBinding>>
bind(ConnectHttp connect, ServerSettings settings)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).connectionSource() insteadakka.stream.javadsl.Source<IncomingConnection,java.util.concurrent.CompletionStage<ServerBinding>>
bind(ConnectHttp connect, ServerSettings settings, akka.event.LoggingAdapter log)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).connectionSource() insteadjava.util.concurrent.CompletionStage<ServerBinding>
bindAndHandle(akka.stream.javadsl.Flow<HttpRequest,HttpResponse,?> handler, ConnectHttp connect, ServerSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bindFlow(handler) instead.java.util.concurrent.CompletionStage<ServerBinding>
bindAndHandle(akka.stream.javadsl.Flow<HttpRequest,HttpResponse,?> handler, ConnectHttp connect, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).bindFlow(handler) instead.java.util.concurrent.CompletionStage<ServerBinding>
bindAndHandleAsync(akka.japi.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler, ConnectHttp connect, ServerSettings settings, int parallelism, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bind(handler) insteadjava.util.concurrent.CompletionStage<ServerBinding>
bindAndHandleAsync(akka.japi.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler, ConnectHttp connect, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).bind(handler) insteadjava.util.concurrent.CompletionStage<ServerBinding>
bindAndHandleSync(akka.japi.Function<HttpRequest,HttpResponse> handler, ConnectHttp connect, ServerSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bindSync(handler) insteadjava.util.concurrent.CompletionStage<ServerBinding>
bindAndHandleSync(akka.japi.Function<HttpRequest,HttpResponse> handler, ConnectHttp connect, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).bindSync(handler) instead<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
cachedHostConnectionPool(ConnectHttp to)
Returns aFlow
which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
cachedHostConnectionPool(ConnectHttp to, ConnectionPoolSettings settings, akka.event.LoggingAdapter log)
Returns aFlow
which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
cachedHostConnectionPool(java.lang.String host)
Returns aFlow
which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
cachedHostConnectionPoolHttps(ConnectHttp to)
Same as<T>cachedHostConnectionPool(java.lang.String)
but with HTTPS encryption.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
cachedHostConnectionPoolHttps(ConnectHttp to, ConnectionPoolSettings settings, akka.event.LoggingAdapter log)
Same as<T>cachedHostConnectionPool(java.lang.String)
but with HTTPS encryption.akka.stream.javadsl.BidiFlow<HttpRequest,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpResponse,akka.NotUsed>
clientLayer(Host hostHeader)
Constructs a client layer stage using the configured defaultClientConnectionSettings
.akka.stream.javadsl.BidiFlow<HttpRequest,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpResponse,akka.NotUsed>
clientLayer(Host hostHeader, ClientConnectionSettings settings)
Constructs a client layer stage using the givenClientConnectionSettings
.akka.stream.javadsl.BidiFlow<HttpRequest,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpResponse,akka.NotUsed>
clientLayer(Host hostHeader, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Constructs a client layer stage using the givenClientConnectionSettings
.OutgoingConnectionBuilder
connectionTo(java.lang.String host)
Creates a builder which will create a single connection to a host every time the built flow is materialized.static Http
createExtension(akka.actor.ExtendedActorSystem system)
HttpsConnectionContext
defaultClientHttpsContext()
Gets the current default client-sideConnectionContext
.ConnectionContext
defaultServerHttpContext()
Deprecated.since 10.2.0: set context explicitly when bindingstatic boolean
equals(java.lang.Object other)
static Http
get(akka.actor.ActorSystem system)
static Http
get(akka.actor.ClassicActorSystemProvider system)
static int
hashCode()
static Http$
lookup()
<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
newHostConnectionPool(ConnectHttp to, ConnectionPoolSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Same as<T>newHostConnectionPool(java.lang.String,akka.stream.Materializer)
but with HTTPS encryption.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
newHostConnectionPool(ConnectHttp to, akka.stream.Materializer materializer)
Starts a new connection pool to the given host and configuration and returns aFlow
which dispatches the requests from all its materializations across this pool.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool>
newHostConnectionPool(java.lang.String host, akka.stream.Materializer materializer)
Starts a new connection pool to the given host and configuration and returns aFlow
which dispatches the requests from all its materializations across this pool.ServerBuilder
newServerAt(java.lang.String interface_, int port)
Main entry point to create a server binding.akka.stream.javadsl.Flow<HttpRequest,HttpResponse,java.util.concurrent.CompletionStage<OutgoingConnection>>
outgoingConnection(ConnectHttp to)
Creates aFlow
representing a prospective HTTP client connection to the given endpoint.akka.stream.javadsl.Flow<HttpRequest,HttpResponse,java.util.concurrent.CompletionStage<OutgoingConnection>>
outgoingConnection(ConnectHttp to, java.util.Optional<java.net.InetSocketAddress> localAddress, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Creates aFlow
representing a prospective HTTP client connection to the given endpoint.akka.stream.javadsl.Flow<HttpRequest,HttpResponse,java.util.concurrent.CompletionStage<OutgoingConnection>>
outgoingConnection(java.lang.String host)
Creates aFlow
representing a prospective HTTP client connection to the given endpoint.akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed>
serverLayer()
Constructs a server layer stage using the configured defaultServerSettings
.akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed>
serverLayer(ServerSettings settings)
Constructs a server layer stage using the givenServerSettings
.akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed>
serverLayer(ServerSettings settings, java.util.Optional<java.net.InetSocketAddress> remoteAddress)
Constructs a server layer stage using the givenServerSettings
.akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed>
serverLayer(ServerSettings settings, java.util.Optional<java.net.InetSocketAddress> remoteAddress, akka.event.LoggingAdapter log)
Constructs a server layer stage using the givenServerSettings
.void
setDefaultClientHttpsContext(HttpsConnectionContext context)
Sets the default client-sideConnectionContext
.void
setDefaultServerHttpContext(ConnectionContext context)
Deprecated.since 10.2.0: set context explicitly when bindingjava.util.concurrent.CompletionStage<scala.runtime.BoxedUnit>
shutdownAllConnectionPools()
Triggers an orderly shutdown of all host connections pools currently maintained by theActorSystem
.java.util.concurrent.CompletionStage<HttpResponse>
singleRequest(HttpRequest request)
Fires a singleHttpRequest
across the (cached) host connection pool for the request's effective URI to produce a response future.java.util.concurrent.CompletionStage<HttpResponse>
singleRequest(HttpRequest request, HttpsConnectionContext connectionContext)
Fires a singleHttpRequest
across the (cached) host connection pool for the request's effective URI to produce a response future.java.util.concurrent.CompletionStage<HttpResponse>
singleRequest(HttpRequest request, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, akka.event.LoggingAdapter log)
Fires a singleHttpRequest
across the (cached) host connection pool for the request's effective URI to produce a response future.<T> akka.japi.Pair<java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>,T>
singleWebSocketRequest(WebSocketRequest request, akka.stream.javadsl.Flow<Message,Message,T> clientFlow, ConnectionContext connectionContext, akka.stream.Materializer materializer)
Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.<T> akka.japi.Pair<java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>,T>
singleWebSocketRequest(WebSocketRequest request, akka.stream.javadsl.Flow<Message,Message,T> clientFlow, ConnectionContext connectionContext, java.util.Optional<java.net.InetSocketAddress> localAddress, ClientConnectionSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.<T> akka.japi.Pair<java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>,T>
singleWebSocketRequest(WebSocketRequest request, akka.stream.javadsl.Flow<Message,Message,T> clientFlow, akka.stream.Materializer materializer)
Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,akka.NotUsed>
superPool()
Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.<T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,akka.NotUsed>
superPool(ConnectionPoolSettings settings, akka.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> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,akka.NotUsed>
superPool(ConnectionPoolSettings settings, HttpsConnectionContext connectionContext, akka.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.akka.stream.javadsl.Flow<Message,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>>
webSocketClientFlow(WebSocketRequest request)
Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.akka.stream.javadsl.Flow<Message,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>>
webSocketClientFlow(WebSocketRequest request, ConnectionContext connectionContext, java.util.Optional<java.net.InetSocketAddress> localAddress, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.akka.stream.javadsl.BidiFlow<Message,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>>
webSocketClientLayer(WebSocketRequest request)
Constructs a WebSocketBidiFlow
.akka.stream.javadsl.BidiFlow<Message,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>>
webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings)
Constructs a WebSocketBidiFlow
using the configured defaultClientConnectionSettings
, configured using theakka.http.client
config section.akka.stream.javadsl.BidiFlow<Message,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>>
webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Constructs a WebSocketBidiFlow
using the configured defaultClientConnectionSettings
, configured using theakka.http.client
config section.
-
-
-
Method Detail
-
get
public static Http get(akka.actor.ActorSystem system)
-
get
public static Http get(akka.actor.ClassicActorSystemProvider system)
-
lookup
public static Http$ lookup()
-
createExtension
public static Http createExtension(akka.actor.ExtendedActorSystem system)
-
apply
public static T apply(akka.actor.ActorSystem system)
-
apply
public static T apply(akka.actor.ClassicActorSystemProvider system)
-
hashCode
public static final int hashCode()
-
equals
public static final boolean equals(java.lang.Object other)
-
serverLayer
public akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed> serverLayer()
Constructs a server layer stage using the configured defaultServerSettings
. The returnedBidiFlow
isn't reusable and can only be materialized once.- Returns:
- (undocumented)
-
serverLayer
public akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed> serverLayer(ServerSettings settings)
Constructs a server layer stage using the givenServerSettings
. The returnedBidiFlow
isn't reusable and can only be materialized once.- Parameters:
settings
- (undocumented)- Returns:
- (undocumented)
-
serverLayer
public akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed> serverLayer(ServerSettings settings, java.util.Optional<java.net.InetSocketAddress> remoteAddress)
Constructs a server layer stage using the givenServerSettings
. The returnedBidiFlow
isn't reusable and can only be materialized once. TheremoteAddress
, if provided, will be added as a header to eachHttpRequest
this layer produces if theakka.http.server.remote-address-header
configuration option is enabled.- Parameters:
settings
- (undocumented)remoteAddress
- (undocumented)- Returns:
- (undocumented)
-
serverLayer
public akka.stream.javadsl.BidiFlow<HttpResponse,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpRequest,akka.NotUsed> serverLayer(ServerSettings settings, java.util.Optional<java.net.InetSocketAddress> remoteAddress, akka.event.LoggingAdapter log)
Constructs a server layer stage using the givenServerSettings
. The returnedBidiFlow
isn't reusable and can only be materialized once. The remoteAddress, if provided, will be added as a header to eachHttpRequest
this layer produces if theakka.http.server.remote-address-header
configuration option is enabled.- Parameters:
settings
- (undocumented)remoteAddress
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
newServerAt
public ServerBuilder newServerAt(java.lang.String interface_, int port)
Main entry point to create a server binding.- Parameters:
interface
- The interface to bind to.port
- The port to bind to or0
if the port should be automatically assigned.interface_
- (undocumented)- Returns:
- (undocumented)
-
bind
public akka.stream.javadsl.Source<IncomingConnection,java.util.concurrent.CompletionStage<ServerBinding>> bind(ConnectHttp connect)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).connectionSource() insteadCreates aSource
ofIncomingConnection
instances 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
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
ServerBinding
.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
connect
- (undocumented)- Returns:
- (undocumented)
-
bind
public akka.stream.javadsl.Source<IncomingConnection,java.util.concurrent.CompletionStage<ServerBinding>> bind(ConnectHttp connect, ServerSettings settings)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).connectionSource() insteadCreates aSource
ofIncomingConnection
instances 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
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
ServerBinding
.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
connect
- (undocumented)settings
- (undocumented)- Returns:
- (undocumented)
-
bind
public akka.stream.javadsl.Source<IncomingConnection,java.util.concurrent.CompletionStage<ServerBinding>> bind(ConnectHttp connect, ServerSettings settings, akka.event.LoggingAdapter log)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).connectionSource() insteadCreates aSource
ofIncomingConnection
instances 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
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
ServerBinding
.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
connect
- (undocumented)settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
bindAndHandle
public java.util.concurrent.CompletionStage<ServerBinding> bindAndHandle(akka.stream.javadsl.Flow<HttpRequest,HttpResponse,?> handler, ConnectHttp connect, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).bindFlow(handler) instead.Convenience method which starts a new HTTP server at the given endpoint and uses the givenhandler
Flow
for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
akka.http.server.max-connections
setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
handler
- (undocumented)connect
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
bindAndHandle
public java.util.concurrent.CompletionStage<ServerBinding> bindAndHandle(akka.stream.javadsl.Flow<HttpRequest,HttpResponse,?> handler, ConnectHttp connect, ServerSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bindFlow(handler) instead.Convenience method which starts a new HTTP server at the given endpoint and uses the givenhandler
Flow
for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
akka.http.server.max-connections
setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
handler
- (undocumented)connect
- (undocumented)settings
- (undocumented)log
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
bindAndHandleSync
public java.util.concurrent.CompletionStage<ServerBinding> bindAndHandleSync(akka.japi.Function<HttpRequest,HttpResponse> handler, ConnectHttp connect, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).bindSync(handler) insteadConvenience method which starts a new HTTP server at the given endpoint and uses the givenhandler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
akka.http.server.max-connections
setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
handler
- (undocumented)connect
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
bindAndHandleSync
public java.util.concurrent.CompletionStage<ServerBinding> bindAndHandleSync(akka.japi.Function<HttpRequest,HttpResponse> handler, ConnectHttp connect, ServerSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bindSync(handler) insteadConvenience method which starts a new HTTP server at the given endpoint and uses the givenhandler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
akka.http.server.max-connections
setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
handler
- (undocumented)connect
- (undocumented)settings
- (undocumented)log
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
bindAndHandleAsync
public java.util.concurrent.CompletionStage<ServerBinding> bindAndHandleAsync(akka.japi.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler, ConnectHttp connect, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).bind(handler) insteadConvenience method which starts a new HTTP server at the given endpoint and uses the givenhandler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
akka.http.server.max-connections
setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
handler
- (undocumented)connect
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
bindAndHandleAsync
public java.util.concurrent.CompletionStage<ServerBinding> bindAndHandleAsync(akka.japi.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler, ConnectHttp connect, ServerSettings settings, int parallelism, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Deprecated.since 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bind(handler) insteadConvenience method which starts a new HTTP server at the given endpoint and uses the givenhandler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
akka.http.server.max-connections
setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.The server will be bound using HTTPS if the
ConnectHttp
object is configured with anHttpsConnectionContext
, or thedefaultServerHttpContext()
has been configured to be anHttpsConnectionContext
.- Parameters:
handler
- (undocumented)connect
- (undocumented)settings
- (undocumented)parallelism
- (undocumented)log
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
clientLayer
public akka.stream.javadsl.BidiFlow<HttpRequest,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpResponse,akka.NotUsed> clientLayer(Host hostHeader)
Constructs a client layer stage using the configured defaultClientConnectionSettings
.- Parameters:
hostHeader
- (undocumented)- Returns:
- (undocumented)
-
clientLayer
public akka.stream.javadsl.BidiFlow<HttpRequest,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpResponse,akka.NotUsed> clientLayer(Host hostHeader, ClientConnectionSettings settings)
Constructs a client layer stage using the givenClientConnectionSettings
.- Parameters:
hostHeader
- (undocumented)settings
- (undocumented)- Returns:
- (undocumented)
-
clientLayer
public akka.stream.javadsl.BidiFlow<HttpRequest,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,HttpResponse,akka.NotUsed> clientLayer(Host hostHeader, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Constructs a client layer stage using the givenClientConnectionSettings
.- Parameters:
hostHeader
- (undocumented)settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
outgoingConnection
public akka.stream.javadsl.Flow<HttpRequest,HttpResponse,java.util.concurrent.CompletionStage<OutgoingConnection>> outgoingConnection(java.lang.String host)
Creates aFlow
representing 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 defaultHttpsConnectionContext
will be used.Prefer
connectionTo(java.lang.String)
over this method.- Parameters:
host
- (undocumented)- Returns:
- (undocumented)
-
outgoingConnection
public akka.stream.javadsl.Flow<HttpRequest,HttpResponse,java.util.concurrent.CompletionStage<OutgoingConnection>> outgoingConnection(ConnectHttp to)
Creates aFlow
representing 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
ConnectHttp
DSL to configure target host and whether HTTPS should be used.Prefer
connectionTo(java.lang.String)
over this method.- Parameters:
to
- (undocumented)- Returns:
- (undocumented)
-
outgoingConnection
public akka.stream.javadsl.Flow<HttpRequest,HttpResponse,java.util.concurrent.CompletionStage<OutgoingConnection>> outgoingConnection(ConnectHttp to, java.util.Optional<java.net.InetSocketAddress> localAddress, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Creates aFlow
representing 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)
-
connectionTo
public OutgoingConnectionBuilder connectionTo(java.lang.String host)
Creates 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>>
.
-
newHostConnectionPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> newHostConnectionPool(java.lang.String host, akka.stream.Materializer materializer)
Starts a new connection pool to the given host and configuration and returns aFlow
which 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
T
from the application which is emitted together with the corresponding response.- Parameters:
host
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
newHostConnectionPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> newHostConnectionPool(ConnectHttp to, akka.stream.Materializer materializer)
Starts a new connection pool to the given host and configuration and returns aFlow
which 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
T
from the application which is emitted together with the corresponding response.- Parameters:
to
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
newHostConnectionPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> newHostConnectionPool(ConnectHttp to, ConnectionPoolSettings settings, akka.event.LoggingAdapter log, akka.stream.Materializer materializer)
Same as<T>newHostConnectionPool(java.lang.String,akka.stream.Materializer)
but with HTTPS encryption.The given
ConnectionContext
will be used for encryption on the connection.- Parameters:
to
- (undocumented)settings
- (undocumented)log
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
cachedHostConnectionPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> cachedHostConnectionPool(java.lang.String host)
Returns aFlow
which 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 returnedFlow
instances 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
T
from the application which is emitted together with the corresponding response.- Parameters:
host
- (undocumented)- Returns:
- (undocumented)
-
cachedHostConnectionPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> cachedHostConnectionPool(ConnectHttp to)
Returns aFlow
which 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 returnedFlow
instances 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
T
from the application which is emitted together with the corresponding response.- Parameters:
to
- (undocumented)- Returns:
- (undocumented)
-
cachedHostConnectionPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> cachedHostConnectionPool(ConnectHttp to, ConnectionPoolSettings settings, akka.event.LoggingAdapter log)
Returns aFlow
which 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 returnedFlow
instances 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
T
from the application which is emitted together with the corresponding response.To configure additional settings for the pool (and requests made using it), use the
akka.http.host-connection-pool
config section or pass in aConnectionPoolSettings
explicitly.- Parameters:
to
- (undocumented)settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
cachedHostConnectionPoolHttps
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> cachedHostConnectionPoolHttps(ConnectHttp to, ConnectionPoolSettings settings, akka.event.LoggingAdapter log)
Same as<T>cachedHostConnectionPool(java.lang.String)
but with HTTPS encryption.When an
HttpConnectionContext
is defined in the givenConnectHttp
it will be used, otherwise the default client-side context will be used.- Parameters:
to
- (undocumented)settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
cachedHostConnectionPoolHttps
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,HostConnectionPool> cachedHostConnectionPoolHttps(ConnectHttp to)
Same as<T>cachedHostConnectionPool(java.lang.String)
but with HTTPS encryption.When an
HttpConnectionContext
is defined in the givenConnectHttp
it will be used, otherwise the default client-side context will be used.- Parameters:
to
- (undocumented)- Returns:
- (undocumented)
-
superPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,akka.NotUsed> superPool()
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 validHost
header.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
andB
enter the flow in that order the response forB
might 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 typeT
from the application which is emitted together with the corresponding response.- Returns:
- (undocumented)
-
superPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,akka.NotUsed> superPool(ConnectionPoolSettings settings, HttpsConnectionContext connectionContext, akka.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 validHost
header.The given
HttpsConnectionContext
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
A
andB
enter theflow
in that order the response forB
might 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
T
from the application which is emitted together with the corresponding response.- Parameters:
settings
- (undocumented)connectionContext
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
superPool
public <T> akka.stream.javadsl.Flow<akka.japi.Pair<HttpRequest,T>,akka.japi.Pair<scala.util.Try<HttpResponse>,T>,akka.NotUsed> superPool(ConnectionPoolSettings settings, akka.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 validHost
header.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
A
andB
enter theflow
in that order the response forB
might 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
T
from the application which is emitted together with the corresponding response.- Parameters:
settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
singleRequest
public java.util.concurrent.CompletionStage<HttpResponse> singleRequest(HttpRequest request)
Fires a singleHttpRequest
across 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
Host
header, otherwise the future will be completed with an error.- Parameters:
request
- (undocumented)- Returns:
- (undocumented)
-
singleRequest
public java.util.concurrent.CompletionStage<HttpResponse> singleRequest(HttpRequest request, HttpsConnectionContext connectionContext)
Fires a singleHttpRequest
across 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
Host
header, otherwise the future will be completed with an error.- Parameters:
request
- (undocumented)connectionContext
- (undocumented)- Returns:
- (undocumented)
-
singleRequest
public java.util.concurrent.CompletionStage<HttpResponse> singleRequest(HttpRequest request, HttpsConnectionContext connectionContext, ConnectionPoolSettings settings, akka.event.LoggingAdapter log)
Fires a singleHttpRequest
across the (cached) host connection pool for the request's effective URI to produce a response future.The given
HttpsConnectionContext
will 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
Host
header, otherwise the future will be completed with an error.- Parameters:
request
- (undocumented)connectionContext
- (undocumented)settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
webSocketClientLayer
public akka.stream.javadsl.BidiFlow<Message,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request)
Constructs a WebSocketBidiFlow
.The layer is not reusable and must only be materialized once.
- Parameters:
request
- (undocumented)- Returns:
- (undocumented)
-
webSocketClientLayer
public akka.stream.javadsl.BidiFlow<Message,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings)
Constructs a WebSocketBidiFlow
using the configured defaultClientConnectionSettings
, configured using theakka.http.client
config section.The layer is not reusable and must only be materialized once.
- Parameters:
request
- (undocumented)settings
- (undocumented)- Returns:
- (undocumented)
-
webSocketClientLayer
public akka.stream.javadsl.BidiFlow<Message,akka.stream.TLSProtocol.SslTlsOutbound,akka.stream.TLSProtocol.SslTlsInbound,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>> webSocketClientLayer(WebSocketRequest request, ClientConnectionSettings settings, akka.event.LoggingAdapter log)
Constructs a WebSocketBidiFlow
using the configured defaultClientConnectionSettings
, configured using theakka.http.client
config section.The layer is not reusable and must only be materialized once.
- Parameters:
request
- (undocumented)settings
- (undocumented)log
- (undocumented)- Returns:
- (undocumented)
-
webSocketClientFlow
public akka.stream.javadsl.Flow<Message,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>> webSocketClientFlow(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)
-
webSocketClientFlow
public akka.stream.javadsl.Flow<Message,Message,java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>> webSocketClientFlow(WebSocketRequest request, ConnectionContext connectionContext, java.util.Optional<java.net.InetSocketAddress> localAddress, ClientConnectionSettings settings, akka.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)
-
singleWebSocketRequest
public <T> akka.japi.Pair<java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, akka.stream.javadsl.Flow<Message,Message,T> clientFlow, akka.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)
-
singleWebSocketRequest
public <T> akka.japi.Pair<java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, akka.stream.javadsl.Flow<Message,Message,T> clientFlow, ConnectionContext connectionContext, akka.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)
-
singleWebSocketRequest
public <T> akka.japi.Pair<java.util.concurrent.CompletionStage<WebSocketUpgradeResponse>,T> singleWebSocketRequest(WebSocketRequest request, akka.stream.javadsl.Flow<Message,Message,T> clientFlow, ConnectionContext connectionContext, java.util.Optional<java.net.InetSocketAddress> localAddress, ClientConnectionSettings settings, akka.event.LoggingAdapter log, akka.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)
-
shutdownAllConnectionPools
public java.util.concurrent.CompletionStage<scala.runtime.BoxedUnit> shutdownAllConnectionPools()
Triggers an orderly shutdown of all host connections pools currently maintained by theActorSystem
. 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)
-
defaultServerHttpContext
public ConnectionContext defaultServerHttpContext()
Deprecated.since 10.2.0: set context explicitly when bindingGets the current default server-sideConnectionContext
– defaults to plain HTTP. Can be modified usingsetDefaultServerHttpContext(akka.http.javadsl.ConnectionContext)
, and will then apply for servers bound after that call has completed.- Returns:
- (undocumented)
-
setDefaultServerHttpContext
public void setDefaultServerHttpContext(ConnectionContext context)
Deprecated.since 10.2.0: set context explicitly when bindingSets the default server-sideConnectionContext
. If it is an instance ofHttpsConnectionContext
then the server will be bound using HTTPS.- Parameters:
context
- (undocumented)
-
defaultClientHttpsContext
public HttpsConnectionContext defaultClientHttpsContext()
Gets the current default client-sideConnectionContext
.- Returns:
- (undocumented)
-
setDefaultClientHttpsContext
public void setDefaultClientHttpsContext(HttpsConnectionContext context)
Sets the default client-sideConnectionContext
.- Parameters:
context
- (undocumented)
-
-