Package

com.github.scalaspring.akka

http

Permalink

package http

Visibility
  1. Public
  2. All

Type Members

  1. class AkkaHttpClient extends HttpClient with AkkaStreamsAutowiredImplicits

    Permalink

    Defines Akka HTTP client components useful for common request operations.

    Defines Akka HTTP client components useful for common request operations.

    Annotations
    @Component()
  2. trait AkkaHttpServer extends AkkaStreamsAutowiredImplicits

    Permalink
  3. class AkkaHttpServerAutoConfiguration extends AkkaStreamsAutowiredImplicits with SpringLogging

    Permalink

    Defines an Akka HTTP server that serves all Akka HTTP routes found in the application context.

    Defines an Akka HTTP server that serves all Akka HTTP routes found in the application context.

    Usage: Import this configuration into your application context.

    Example:

    @Configuration
    @Import(Array(classOf[AkkaHttpServerAutoConfiguration]))
    class Configuration extends MyService
    Annotations
    @Configuration() @EnableConfigurationProperties() @Import()
  4. trait AkkaHttpService extends AnyRef

    Permalink

    Base trait used to define services.

    Base trait used to define services. Defines the service route bean used by [AkkaHttpServerAutoConfiguration].

    This trait is designed to be stackable, allowing multiple services to be implemented in a single server.

    Usage: Extend this trait and override the route function to create your service.

    Example: Note the use of abstract override and the concatenation of super.route to make the service stackable.

    // Define the service route in trait
    trait EchoService extends AkkaHttpService {
      abstract override def route: Route = {
        get {
          path("echo" / Segment) { name =>
            complete(name)
          }
        }
      } ~ super.route
    }
    
    // Implement the trait in your application configuration
    @Configuration
    @Import(Array(classOf[AkkaHttpServerAutoConfiguration]))
    class Configuration extends EchoService
  5. class AkkaStreamsAutoConfiguration extends AkkaAutowiredImplicits with SpringLogging

    Permalink

    Configures Spring to materialize Akka Streams flows via Akka.

    Configures Spring to materialize Akka Streams flows via Akka.

    Annotations
    @Configuration() @Import()
  6. trait AkkaStreamsAutowiredImplicits extends AkkaAutowiredImplicits

    Permalink

    Defines autowired implicits needed to materialize Akka Streams flows.

  7. trait HttpClient extends AnyRef

    Permalink

    Defines a basic HTTP client useful for common request operations.

  8. class ServerBindingLifecycle extends SmartLifecycle with AkkaStreamsAutowiredImplicits with StrictLogging

    Permalink

    Manages the lifecycle of an Akka HTTP ServerBinding, ensuring its lifecycle matches that of the containing Spring application context.

    Manages the lifecycle of an Akka HTTP ServerBinding, ensuring its lifecycle matches that of the containing Spring application context.

    This is an internal management class and is not intended for direct use. An instance is automatically created by [AkkaHttpServerAutoConfiguration].

    The Spring lifecycle phase (default 10) can be adjusted by setting the http.server.lifecycle.phase configuration property. Note that the phase MUST be greater than that of the ActorSystemLifecycle bean to ensure the underlying ActorSystem is started before, and is terminated after, the Akka HTTP server.

  9. class ServerSettings extends AnyRef

    Permalink

    HTTP server settings with defaults.

    HTTP server settings with defaults.

    This is a standard Spring Boot configuration properties class that will be populated by Spring using property sources available in the application context. HTTP server settings are read from properties prefixed with 'http.server'

    Example YAML configuration (application.yaml)

    http:
      server:
        interface: localhost
        port: 8080
    Annotations
    @ConfigurationProperties()

Value Members

  1. object AkkaHttpClient

    Permalink
  2. object ServerBindingLifecycle

    Permalink
  3. object ServerSettings

    Permalink

Ungrouped