Package kalix.javasdk.action
Interface ActionCreationContext
- All Superinterfaces:
Context
- All Known Subinterfaces:
ActionContext
Creation context for
Action
components.
This may be accepted as an argument to the constructor of an Action.
-
Method Summary
Modifier and TypeMethodDescription<T> T
getGrpcClient
(Class<T> clientClass, String service) Get an Akka gRPC client for the given service name.Optional
<io.opentelemetry.api.trace.Tracer> Deprecated.use getTracer() instead.io.opentelemetry.api.trace.Tracer
Get an OpenTelemetry tracer for the current action.Methods inherited from interface kalix.javasdk.Context
materializer
-
Method Details
-
getGrpcClient
Get an Akka gRPC client for the given service name. The same client instance is shared across components in the application. The lifecycle of the client is managed by the SDK and it should not be stopped by user code.- Type Parameters:
T
- The "service" interface generated for the service by Akka gRPC- Parameters:
clientClass
- The class of a gRPC service generated by Akka gRPCservice
- The name of the service to connect to, either a name of another Kalix service or an external service where connection details are configured under `akka.grpc.client.[service-name]` in `application.conf`.
-
getOpenTelemetryTracer
Deprecated.use getTracer() instead.Get an OpenTelemetry tracer for the current action. This will allow for building and automatic exporting of spans.- Returns:
- A tracer for the current action, if tracing is configured.
-
getTracer
io.opentelemetry.api.trace.Tracer getTracer()Get an OpenTelemetry tracer for the current action. This will allow for building and automatic exporting of spans.- Returns:
- A tracer for the current action, if tracing is configured. Otherwise, a noops tracer.
-