class Http extends Extension
- Alphabetic
- By Inheritance
- Http
- Extension
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Http(system: ExtendedActorSystem)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Http, B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def cachedHostConnectionPool[T](to: ConnectHttp, settings: ConnectionPoolSettings, log: LoggingAdapter): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Returns a pekko.stream.javadsl.Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.
Returns a pekko.stream.javadsl.Flow 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 returned pekko.stream.javadsl.Flow 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
pekko.http.host-connection-pool
config section or pass in a ConnectionPoolSettings explicitly. - def cachedHostConnectionPool[T](to: ConnectHttp): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Returns a pekko.stream.javadsl.Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.
Returns a pekko.stream.javadsl.Flow 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 returned pekko.stream.javadsl.Flow 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. - def cachedHostConnectionPool[T](host: String): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Returns a pekko.stream.javadsl.Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.
Returns a pekko.stream.javadsl.Flow 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 returned pekko.stream.javadsl.Flow 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. - def cachedHostConnectionPoolHttps[T](to: ConnectHttp): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Same as cachedHostConnectionPool but with HTTPS encryption.
Same as cachedHostConnectionPool but with HTTPS encryption.
When an HttpConnectionContext is defined in the given ConnectHttp it will be used, otherwise the default client-side context will be used.
- def cachedHostConnectionPoolHttps[T](to: ConnectHttp, settings: ConnectionPoolSettings, log: LoggingAdapter): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Same as cachedHostConnectionPool but with HTTPS encryption.
Same as cachedHostConnectionPool but with HTTPS encryption.
When an HttpConnectionContext is defined in the given ConnectHttp it will be used, otherwise the default client-side context will be used.
- def clientLayer(hostHeader: Host, settings: ClientConnectionSettings, log: LoggingAdapter): BidiFlow[HttpRequest, SslTlsOutbound, SslTlsInbound, HttpResponse, NotUsed]
Constructs a client layer stage using the given ClientConnectionSettings.
- def clientLayer(hostHeader: Host, settings: ClientConnectionSettings): BidiFlow[HttpRequest, SslTlsOutbound, SslTlsInbound, HttpResponse, NotUsed]
Constructs a client layer stage using the given pekko.http.javadsl.settings.ClientConnectionSettings.
- def clientLayer(hostHeader: Host): BidiFlow[HttpRequest, SslTlsOutbound, SslTlsInbound, HttpResponse, NotUsed]
Constructs a client layer stage using the configured default pekko.http.javadsl.settings.ClientConnectionSettings.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def connectionTo(host: String): OutgoingConnectionBuilder
Creates a builder which will create a single connection to a host every time the built flow is materialized.
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 see singleRequest()
- returns
A builder to configure more specific setup for the connection and then build a
Flow>Request, Response, CompletionStage>OutgoingConnection>>
.
- def defaultClientHttpsContext: HttpsConnectionContext
Gets the current default client-side ConnectionContext.
- def ensuring(cond: (Http) => Boolean, msg: => Any): Http
- def ensuring(cond: (Http) => Boolean): Http
- def ensuring(cond: Boolean, msg: => Any): Http
- def ensuring(cond: Boolean): Http
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newHostConnectionPool[T](to: ConnectHttp, settings: ConnectionPoolSettings, log: LoggingAdapter, materializer: Materializer): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Same as newHostConnectionPool but with HTTPS encryption.
Same as newHostConnectionPool but with HTTPS encryption.
The given ConnectionContext will be used for encryption on the connection.
- def newHostConnectionPool[T](to: ConnectHttp, materializer: Materializer): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Starts a new connection pool to the given host and configuration and returns a pekko.stream.javadsl.Flow which dispatches the requests from all its materializations across this pool.
Starts a new connection pool to the given host and configuration and returns a pekko.stream.javadsl.Flow 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. - def newHostConnectionPool[T](host: String, materializer: Materializer): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], HostConnectionPool]
Starts a new connection pool to the given host and configuration and returns a pekko.stream.javadsl.Flow which dispatches the requests from all its materializations across this pool.
Starts a new connection pool to the given host and configuration and returns a pekko.stream.javadsl.Flow 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. - def newServerAt(interface: String, port: Int): ServerBuilder
Main entry point to create a server binding.
Main entry point to create a server binding.
- interface
The interface to bind to.
- port
The port to bind to or
0
if the port should be automatically assigned.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def outgoingConnection(to: ConnectHttp, localAddress: Optional[InetSocketAddress], settings: ClientConnectionSettings, log: LoggingAdapter): Flow[HttpRequest, HttpResponse, CompletionStage[OutgoingConnection]]
Creates a pekko.stream.javadsl.Flow representing a prospective HTTP client connection to the given endpoint.
Creates a pekko.stream.javadsl.Flow 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 over this method.
- def outgoingConnection(to: ConnectHttp): Flow[HttpRequest, HttpResponse, CompletionStage[OutgoingConnection]]
Creates a pekko.stream.javadsl.Flow representing a prospective HTTP client connection to the given endpoint.
Creates a pekko.stream.javadsl.Flow 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 over this method.
- def outgoingConnection(host: String): Flow[HttpRequest, HttpResponse, CompletionStage[OutgoingConnection]]
Creates a pekko.stream.javadsl.Flow representing a prospective HTTP client connection to the given endpoint.
Creates a pekko.stream.javadsl.Flow 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 default HttpsConnectionContext will be used.Prefer connectionTo over this method.
- def serverLayer(settings: ServerSettings, remoteAddress: Optional[InetSocketAddress], log: LoggingAdapter): BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, NotUsed]
Constructs a server layer stage using the given ServerSettings.
Constructs a server layer stage using the given ServerSettings. The returned pekko.stream.javadsl.BidiFlow isn't reusable and can only be materialized once. The remoteAddress, if provided, will be added as a header to each HttpRequest this layer produces if the
pekko.http.server.remote-address-header
configuration option is enabled. - def serverLayer(settings: ServerSettings, remoteAddress: Optional[InetSocketAddress]): BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, NotUsed]
Constructs a server layer stage using the given pekko.http.javadsl.settings.ServerSettings.
Constructs a server layer stage using the given pekko.http.javadsl.settings.ServerSettings. The returned pekko.stream.javadsl.BidiFlow isn't reusable and can only be materialized once. The
remoteAddress
, if provided, will be added as a header to each HttpRequest this layer produces if thepekko.http.server.remote-address-header
configuration option is enabled. - def serverLayer(settings: ServerSettings): BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, NotUsed]
Constructs a server layer stage using the given pekko.http.javadsl.settings.ServerSettings.
Constructs a server layer stage using the given pekko.http.javadsl.settings.ServerSettings. The returned pekko.stream.javadsl.BidiFlow isn't reusable and can only be materialized once.
- def serverLayer(): BidiFlow[HttpResponse, SslTlsOutbound, SslTlsInbound, HttpRequest, NotUsed]
Constructs a server layer stage using the configured default pekko.http.javadsl.settings.ServerSettings.
Constructs a server layer stage using the configured default pekko.http.javadsl.settings.ServerSettings. The returned pekko.stream.javadsl.BidiFlow isn't reusable and can only be materialized once.
- def setDefaultClientHttpsContext(context: HttpsConnectionContext): Unit
Sets the default client-side ConnectionContext.
- def shutdownAllConnectionPools(): CompletionStage[Unit]
Triggers an orderly shutdown of all host connections pools currently maintained by the pekko.actor.ActorSystem.
Triggers an orderly shutdown of all host connections pools currently maintained by the pekko.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.
- def singleRequest(request: HttpRequest, connectionContext: HttpsConnectionContext, settings: ConnectionPoolSettings, log: LoggingAdapter): CompletionStage[HttpResponse]
Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.
Fires a single HttpRequest 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. - def singleRequest(request: HttpRequest, connectionContext: HttpsConnectionContext): CompletionStage[HttpResponse]
Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.
Fires a single HttpRequest 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. - def singleRequest(request: HttpRequest): CompletionStage[HttpResponse]
Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.
Fires a single HttpRequest 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. - def singleWebSocketRequest[T](request: WebSocketRequest, clientFlow: Flow[Message, Message, T], connectionContext: ConnectionContext, localAddress: Optional[InetSocketAddress], settings: ClientConnectionSettings, log: LoggingAdapter, materializer: Materializer): Pair[CompletionStage[WebSocketUpgradeResponse], T]
Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.
- def singleWebSocketRequest[T](request: WebSocketRequest, clientFlow: Flow[Message, Message, T], connectionContext: ConnectionContext, materializer: Materializer): Pair[CompletionStage[WebSocketUpgradeResponse], T]
Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.
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.
- def singleWebSocketRequest[T](request: WebSocketRequest, clientFlow: Flow[Message, Message, T], materializer: Materializer): Pair[CompletionStage[WebSocketUpgradeResponse], T]
Runs a single WebSocket conversation given a Uri and a flow that represents the client side of the WebSocket conversation.
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.
- def superPool[T](settings: ConnectionPoolSettings, log: LoggingAdapter): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], NotUsed]
Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.
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 valid
Host
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. - def superPool[T](settings: ConnectionPoolSettings, connectionContext: HttpsConnectionContext, log: LoggingAdapter): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], NotUsed]
Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.
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 valid
Host
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. - def superPool[T](): Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], NotUsed]
Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URIs.
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 valid
Host
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. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def webSocketClientFlow(request: WebSocketRequest, connectionContext: ConnectionContext, localAddress: Optional[InetSocketAddress], settings: ClientConnectionSettings, log: LoggingAdapter): Flow[Message, Message, CompletionStage[WebSocketUpgradeResponse]]
Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.
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.
- def webSocketClientFlow(request: WebSocketRequest): Flow[Message, Message, CompletionStage[WebSocketUpgradeResponse]]
Constructs a flow that once materialized establishes a WebSocket connection to the given Uri.
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.
- def webSocketClientLayer(request: WebSocketRequest, settings: ClientConnectionSettings, log: LoggingAdapter): BidiFlow[Message, SslTlsOutbound, SslTlsInbound, Message, CompletionStage[WebSocketUpgradeResponse]]
Constructs a WebSocket pekko.stream.javadsl.BidiFlow using the configured default ClientConnectionSettings, configured using the
pekko.http.client
config section.Constructs a WebSocket pekko.stream.javadsl.BidiFlow using the configured default ClientConnectionSettings, configured using the
pekko.http.client
config section.The layer is not reusable and must only be materialized once.
- def webSocketClientLayer(request: WebSocketRequest, settings: ClientConnectionSettings): BidiFlow[Message, SslTlsOutbound, SslTlsInbound, Message, CompletionStage[WebSocketUpgradeResponse]]
Constructs a WebSocket pekko.stream.javadsl.BidiFlow using the configured default ClientConnectionSettings, configured using the
pekko.http.client
config section.Constructs a WebSocket pekko.stream.javadsl.BidiFlow using the configured default ClientConnectionSettings, configured using the
pekko.http.client
config section.The layer is not reusable and must only be materialized once.
- def webSocketClientLayer(request: WebSocketRequest): BidiFlow[Message, SslTlsOutbound, SslTlsInbound, Message, CompletionStage[WebSocketUpgradeResponse]]
Constructs a WebSocket pekko.stream.javadsl.BidiFlow.
Constructs a WebSocket pekko.stream.javadsl.BidiFlow.
The layer is not reusable and must only be materialized once.
Deprecated Value Members
- def bind(connect: ConnectHttp, settings: ServerSettings, log: LoggingAdapter): Source[IncomingConnection, CompletionStage[ServerBinding]]
Creates a pekko.stream.javadsl.Source of IncomingConnection instances which represents a prospective HTTP server binding on the given
endpoint
.Creates a pekko.stream.javadsl.Source of IncomingConnection instances which represents a prospective HTTP server binding on the given
endpoint
.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bind(connect: ConnectHttp, settings: ServerSettings): Source[IncomingConnection, CompletionStage[ServerBinding]]
Creates a pekko.stream.javadsl.Source of IncomingConnection instances which represents a prospective HTTP server binding on the given
endpoint
.Creates a pekko.stream.javadsl.Source of IncomingConnection instances which represents a prospective HTTP server binding on the given
endpoint
.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bind(connect: ConnectHttp): Source[IncomingConnection, CompletionStage[ServerBinding]]
Creates a pekko.stream.javadsl.Source of IncomingConnection instances which represents a prospective HTTP server binding on the given
endpoint
.Creates a pekko.stream.javadsl.Source of IncomingConnection instances which represents a prospective HTTP server binding on the given
endpoint
.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bindAndHandle(handler: Flow[HttpRequest, HttpResponse, _], connect: ConnectHttp, settings: ServerSettings, log: LoggingAdapter, materializer: Materializer): CompletionStage[ServerBinding]
Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
pekko.stream.javadsl.Flow for processing all incoming connections.Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
pekko.stream.javadsl.Flow for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
pekko.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bindAndHandle(handler: Flow[HttpRequest, HttpResponse, _], connect: ConnectHttp, materializer: Materializer): CompletionStage[ServerBinding]
Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
pekko.stream.javadsl.Flow for processing all incoming connections.Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
pekko.stream.javadsl.Flow for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
pekko.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bindAndHandleAsync(handler: Function[HttpRequest, CompletionStage[HttpResponse]], connect: ConnectHttp, settings: ServerSettings, parallelism: Int, log: LoggingAdapter, materializer: Materializer): CompletionStage[ServerBinding]
Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
pekko.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bindAndHandleAsync(handler: Function[HttpRequest, CompletionStage[HttpResponse]], connect: ConnectHttp, materializer: Materializer): CompletionStage[ServerBinding]
Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
pekko.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bindAndHandleSync(handler: Function[HttpRequest, HttpResponse], connect: ConnectHttp, settings: ServerSettings, log: LoggingAdapter, materializer: Materializer): CompletionStage[ServerBinding]
Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
pekko.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def bindAndHandleSync(handler: Function[HttpRequest, HttpResponse], connect: ConnectHttp, materializer: Materializer): CompletionStage[ServerBinding]
Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.Convenience method which starts a new HTTP server at the given endpoint and uses the given
handler
function for processing all incoming connections.The number of concurrently accepted connections can be configured by overriding the
pekko.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 an HttpsConnectionContext, or the defaultServerHttpContext has been configured to be an HttpsConnectionContext.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Use newServerAt instead
- def createClientHttpsContext(sslConfig: PekkoSSLConfig): HttpsConnectionContext
- Annotations
- @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) use ConnectionContext.httpsClient
- def createDefaultClientHttpsContext(): HttpsConnectionContext
- Annotations
- @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) use ConnectionContext.httpsClient
- def createServerHttpsContext(sslConfig: PekkoSSLConfig): HttpsConnectionContext
- Annotations
- @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) use ConnectionContext.httpsServer
- def defaultServerHttpContext: ConnectionContext
Gets the current default server-side ConnectionContext – defaults to plain HTTP.
Gets the current default server-side ConnectionContext – defaults to plain HTTP. Can be modified using setDefaultServerHttpContext, and will then apply for servers bound after that call has completed.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Set context explicitly when binding
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Http toStringFormat[Http] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def setDefaultServerHttpContext(context: ConnectionContext): Unit
Sets the default server-side ConnectionContext.
Sets the default server-side ConnectionContext. If it is an instance of HttpsConnectionContext then the server will be bound using HTTPS.
- Annotations
- @Deprecated @deprecated
- Deprecated
(Since version Akka HTTP 10.2.0) Set context explicitly when binding
- def →[B](y: B): (Http, B)
- Implicit
- This member is added by an implicit conversion from Http toArrowAssoc[Http] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.