Skip to content

docs: Actor App-Initiated gRPC Event Streams (SubscribeActorEventsAlpha1)#5182

Open
nelson-parente wants to merge 3 commits into
dapr:v1.18from
nelson-parente:docs/1.18-actor-app-initiated-streams
Open

docs: Actor App-Initiated gRPC Event Streams (SubscribeActorEventsAlpha1)#5182
nelson-parente wants to merge 3 commits into
dapr:v1.18from
nelson-parente:docs/1.18-actor-app-initiated-streams

Conversation

@nelson-parente
Copy link
Copy Markdown
Contributor

Summary

Documents SubscribeActorEventsAlpha1, the flagship new alpha API in Dapr v1.18 that lets actor-hosting apps receive all callbacks over a single bidirectional gRPC stream initiated from the app to the sidecar, with no inbound server port required.

Files changed

File Description
daprdocs/content/en/developing-applications/building-blocks/actors/actors-app-initiated-streams.md New concept page. Explains the app→sidecar streaming protocol, why it exists (replaces inbound actor callbacks), comparison table with traditional callbacks, protocol walk-through, rolling-restart / multi-connection behavior, and NetworkPolicy / firewall guidance for operators including a sample Kubernetes NetworkPolicy manifest. Marked Alpha prominently.
daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-app-initiated-streams.md New how-to page. Step-by-step guide: open the stream, send the initial registration, handle all four callback types (invoke, reminder, timer, deactivate), signal errors with request_failed, and implement reconnection with exponential back-off. Includes full raw gRPC Go code examples.
daprdocs/content/en/reference/api/actors_api.md Extended. New SubscribeActorEventsAlpha1 (gRPC) section with the gRPC service definition and complete field-level reference tables for all request/response proto messages.
daprdocs/content/en/operations/support/alpha-beta-apis.md Updated. Added Actor App-Initiated Streams row to the Alpha APIs table.

Test plan

  • Verify Hugo build passes (no broken {{< ref >}} links)
  • Confirm weight: 55 and weight: 56 don't collide with existing actor pages (current highest non-how-to weight in the folder is actors-timers-reminders.md — check _index.md ordering)
  • Cross-check proto field names against merged dapr/dapr#9812 once final proto is tagged in v1.18
  • Confirm SDK-specific code examples can be added once .NET / Python / Java SDK PRs land (tracked separately)
  • Verify NetworkPolicy example port matches the actual default daprd gRPC port annotation default

Open questions / TODOs for reviewer

  1. SDK examples: The how-to currently has only a raw Go gRPC example. SDK-level wrappers for .NET, Python, Java, and Go are being added in parallel SDK PRs. Once those land, SDK tabs should be added to the {{< tabpane >}} in the how-to.
  2. Proto link in alpha-beta-apis.md: The link to the proto file points to master. Replace with a tagged v1.18 permalink once the release tag is cut.
  3. Weight values: weight: 55 and weight: 56 are slotted between howto-actors.md (no explicit weight) and the existing pages. Verify the rendered nav order looks right.
  4. howto-actors-partitioning.md weight: The v1.18 branch may have different weight values if other actor pages were added. Double-check.
  5. actors-overview.md cross-link: Consider adding a bullet under the "Features" section of actors-overview.md pointing to the new concept page for discoverability. Not blocking.

Targets v1.18. Draft pending review.

Add documentation for SubscribeActorEventsAlpha1, the new bidirectional
gRPC stream that lets actor-hosting apps receive all callbacks (invoke,
reminder, timer, deactivate) over an app-initiated connection to daprd,
without exposing an inbound server port.

Closes dapr/dapr#927. Introduced in Dapr v1.18 via dapr/dapr#9812.

Files added/changed:
- actors-app-initiated-streams.md: concept page explaining the protocol,
  the motivation, how it differs from traditional callbacks, and
  NetworkPolicy / firewall guidance for operators.
- howto-actors-app-initiated-streams.md: how-to guide with step-by-step
  instructions and raw gRPC code examples in Go.
- actors_api.md: new SubscribeActorEventsAlpha1 gRPC section with full
  proto reference tables for all request/response message types.
- alpha-beta-apis.md: add row for the new alpha API.

Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
@nelson-parente nelson-parente marked this pull request as ready for review May 22, 2026 10:04
@nelson-parente nelson-parente requested review from a team as code owners May 22, 2026 10:04
@acroca acroca mentioned this pull request Jun 3, 2026
@marcduiker marcduiker added this to the v1.18 milestone Jun 3, 2026
## Protocol summary

```
App daprd (Dapr sidecar)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you convert this to a mermaid style diagram? Don't worry about formatting, I'll prepare something for this later.

---

{{% alert title="Alpha" color="warning" %}}
`SubscribeActorEventsAlpha1` is in alpha. The API shape may change in a future release.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which SDKs support this atm? Can you add this info here?

| **SDK support** | All SDKs | SDKs adding support (see below) |
| **Stability** | Stable | Alpha (v1.18+) |

The app-initiated approach is useful when NetworkPolicies restrict inbound traffic to application pods, when actors run in restricted-networking environments, or when you want a single connection-management surface instead of per-callback HTTP/gRPC routes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this sentence above the table, so the question in the h2 is answered immediately.


## SDK support

SDK helpers for `SubscribeActorEventsAlpha1` are not yet available; use the generated gRPC client directly. See the [how-to guide]({{% ref "howto-actors-app-initiated-streams" %}}) for a raw gRPC example in Go. SDK support is being tracked in the v1.18 SDK releases.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, this explains the SDKs question. I suggest to remove this: "SDK support is being tracked in the v1.18 SDK releases." This is not typically mentioned in docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants