Class DaprComponentOptions
- Namespace
- Virtufin.Api.Configuration
- Assembly
- Virtufin.Api.dll
The Dapr component names the gateway talks to. Resolved once at startup and injected, rather than hard-coded at each call site.
public sealed class DaprComponentOptions
- Inheritance
-
DaprComponentOptions
- Inherited Members
Remarks
Two knobs for the pub/sub component name existed and neither was read: the
--pubsub-name / PubsubName setting, and the per-service
pubsub.pubsubName field in services.json (which helm emits from
.Values.pubsub.name). Publishing and subscribing used the literal
"pubsub", so renaming the component in helm produced a deployment that
looked configured and could not publish.
The per-service field cannot be honoured per service: Pubsub.PublishEvent and
Pubsub.Subscribe take a topic and no service, so there is nothing to resolve
against at call time. It is therefore treated as a gateway-wide setting that every
entry must agree on — which is how it is actually produced, since helm renders one
value into every entry.
Constructors
DaprComponentOptions(string)
public DaprComponentOptions(string pubsubName)
Parameters
pubsubNamestring
Fields
DefaultPubsubName
Component name used when nothing is configured.
public const string DefaultPubsubName = "pubsub"
Field Value
PubsubNameKey
Configuration key backing --pubsub-name.
public const string PubsubNameKey = "PubsubName"
Field Value
Properties
PubsubName
public string PubsubName { get; }
Property Value
Methods
Resolve(string?, ServicesConfiguration)
Resolves the pub/sub component name. Precedence: the explicit
PubsubName setting, then the value services.json agrees on, then the default.
public static DaprComponentOptions Resolve(string? explicitName, ServicesConfiguration config)
Parameters
explicitNamestringconfigServicesConfiguration
Returns
Exceptions
- InvalidOperationException
Thrown when registered services declare different
pubsub.pubsubNamevalues. Only one can be honoured, and silently picking one would reintroduce exactly the "configured but ignored" behaviour this replaces.