Skip to content

Spring Boot autoconfiguration for hosting actors over gRPC #1839

Open

Description

@javier-aliaga

Follow-up to #1761.

#1761 adds ActorRuntime.subscribeActorEvents(), which hosts actors over the app-initiated gRPC stream (SubscribeActorEventsAlpha1). Today a Spring Boot app must call it by hand, and the Spring integration still exposes the HTTP actor endpoints in DaprController.

Proposal

Add an opt-in property to the Spring Boot autoconfiguration, for example dapr.actors.transport=grpc (default http):

  • When set to grpc, start the subscription once the application context is ready, after the actor types are registered, and close it on shutdown.
  • Leave the HTTP actor endpoints as they are. daprd decides which transport is used: it rejects the stream when it has an HTTP app channel, so the app must run without --app-port or with --app-protocol grpc.
  • Expose the ActorEventSubscription as a bean so apps can check isRunning() (for example from a health indicator).

Acceptance criteria

  • With the property set, a Spring Boot app hosts its registered actors over gRPC with no extra code.
  • The default behaviour (HTTP) is unchanged.
  • Tests cover the autoconfiguration. An integration test runs a Spring Boot actor app over gRPC with daprd and no app port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions