Class DaprStableJobCallbackMethodProvider
Serves the Dapr scheduler's job callback on its stable route,
/dapr.proto.runtime.v1.AppCallback/OnJobEvent.
Why this exists: the Dapr runtime (confirmed on 1.18.1) delivers
scheduled jobs to AppCallback/OnJobEvent — the stable service, per
dapr/dapr's own appcallback.proto. The .NET SDK lags it: the
generated code in Dapr.Protos 1.18.2 contains
OnJobEventAlpha1 on AppCallbackAlpha and no
OnJobEvent anywhere, so
DaprAppCallbackService could only ever bind the alpha
route. Nothing served the route Dapr actually calls, the request
matched no endpoint, and it was rejected 401 by
ApiKeyHttpMiddleware (which exempts only requests whose matched
endpoint carries GrpcMethodMetadata). Net effect: **no scheduled
trigger ever fired**, while Dapr retried roughly once a second forever.
Registering the method here rather than regenerating
appcallback.proto into this repo is deliberate: the request and
response types already exist in Dapr.Protos and are reused
as-is, so there is no second copy of the Dapr message types to collide
with the SDK's (the CS0433 duplicate-type trap this codebase has hit
before). Only the service/method *name* differs.
Because the endpoint is produced through the normal gRPC service-model
pipeline it carries GrpcMethodMetadata, so
ApiKeyHttpMiddleware lets it through to
ApiKeyInterceptor, which exempts the
/dapr.proto.runtime.v1.AppCallback/ prefix — the sidecar cannot
present an API key.
Both routes stay live: the alpha one for older runtimes, this one for
current ones. They share a single handler, so behaviour cannot drift.
Once the SDK generates the stable method, this provider can be replaced
by a plain override OnJobEvent on
DaprAppCallbackService.
public sealed class DaprStableJobCallbackMethodProvider : IServiceMethodProvider<DaprAppCallbackService>
- Inheritance
-
DaprStableJobCallbackMethodProvider
- Implements
- Inherited Members
Methods
OnServiceMethodDiscovery(ServiceMethodProviderContext<DaprAppCallbackService>)
Called to execute the provider.
public void OnServiceMethodDiscovery(ServiceMethodProviderContext<DaprAppCallbackService> context)