Package akka.javasdk
Interface ServiceSetup
public interface ServiceSetup
Implement this on a single class per deployable service annotated with {
Setup
} and
override one or more of the default methods to provide objects for dependency injection or act on
service lifecycle events.
Concrete classes can accept the following types to the constructor:
ComponentClient
HttpClientProvider
TimerScheduler
Materializer
Config
-
Method Summary
Modifier and TypeMethodDescriptiondefault DependencyProvider
Invoked once before service is started, to create a dependency provider.default void
The on startup hook is called every time a service instance boots up.
-
Method Details
-
onStartup
default void onStartup()The on startup hook is called every time a service instance boots up. This can happen for very different reasons: restarting / redeploying the service, scaling up to more instances or even without any user-driven action (e.g. Runtime versions being rolled out, infrastructure-related incidents, etc.). Therefore, one should carefully consider how to use this hook and its implementation.This hook is called after
createDependencyProvider()
. -
createDependencyProvider
Invoked once before service is started, to create a dependency provider. It is not possible to interact with components in this method.This hook is called before
onStartup()
.
-