Interface ActionCreationContext

All Superinterfaces:
Context
All Known Subinterfaces:
ActionContext

public interface ActionCreationContext extends Context
Creation context for Action components.

This may be accepted as an argument to the constructor of an Action.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getGrpcClient(Class<T> clientClass, String service)
    Get an Akka gRPC client for the given service name.
    Optional<io.opentelemetry.api.trace.Tracer>
    Get an OpenTelemetry tracer for the current action.

    Methods inherited from interface kalix.javasdk.Context

    materializer
  • Method Details

    • getGrpcClient

      <T> T getGrpcClient(Class<T> clientClass, String service)
      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 gRPC
      service - 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

      Optional<io.opentelemetry.api.trace.Tracer> getOpenTelemetryTracer()
      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.