SAIF.NCore.Messaging reads ten settings through three mechanisms: seven keys
under the Messaging section of IConfiguration, bound to MessagingOptions
and OutboxOptions; two values from IEnvironmentClient, one plain and one
secure, applied to MessagingOptions after binding; and one process
environment variable that disables the outbox dispatcher. Only
Messaging:ServiceName is mandatory. The configuration keys are read when an
options object is first resolved, and the environment variable is read once,
while AddSaifMessagingOutbox runs at startup.
AddSaifMessaging binds the Messaging section to MessagingOptions, and AddSaifMessagingOutbox binds Messaging:Outbox to OutboxOptions.
GetSettingValue
IEnvironmentClient
SAIF.NetCore.Environment
Called by ConfigureMessagingOptions.PostConfigure with section Messaging and key TopicPrefix, only after HasSetting returns true.
HasSetting
IEnvironmentClient
SAIF.NetCore.Environment
Called by ConfigureMessagingOptions.PostConfigure to test for Messaging:TopicPrefix before reading it.
GetSecureSetting
IEnvironmentClient
SAIF.NetCore.Environment
Called by ConfigureMessagingOptions.PostConfigure with section Messaging, key ConnectionString, and the SystemType argument; decryption happens inside the environment client.
GetEnvironmentVariable
Environment
System
Called by AddSaifMessagingOutbox with the variable name and no target, so the process scope is read.
true or false, case-insensitive; any other value is treated as false
false
When true, AddSaifMessagingOutbox does not register OutboxDispatchService. The process still writes outbox rows but never dispatches them. The value is read once at startup, so a change needs a restart.
ConfigureMessagingOptions cannot be constructed, so resolving IOptions<MessagingOptions> throws InvalidOperationException and MessagePublisher and ServiceBusClientAdapter fail to resolve.
Messaging section in appsettings.json
section
Runtime, when MessagePublisher is first resolved
MessagingOptions keeps its code defaults, but ServiceName has none, so MessagePublisher throws InvalidOperationException on first resolution and nothing can be published.
Messaging:ConnectionString secure setting
secure setting
Runtime, when ServiceBusClientAdapter is first resolved
The connection string stays unset and ServiceBusClientAdapter throws InvalidOperationException on first resolution; no message is sent or received.
Messaging:TopicPrefix setting
setting
Runtime, when MessagingOptions is first resolved
HasSetting returns false and the prefix stays empty, so topic names are used unprefixed.
IOutboxConnectionFactory
service
Runtime, on each outbox dispatch cycle and each outbox publish
SqlOutboxStore cannot be constructed. OutboxDispatchService logs the failure and retries after the poll interval, and MessagePublisher throws InvalidOperationException when it resolves the outbox store.
Note: Statements marked with † are derived from dependency library
documentation via the Legends CLI. They describe inherited behavior from the
indicated origin library and should be verified if the dependency version changes.