< Summary - AsyncResponse (Release / net8.0+net10.0 / unit+integration)

Information
Class: AsyncResponse.AsyncResponseOptions
Assembly: AsyncResponse.Core
File(s): /_/src/AsyncResponse.Core/AsyncResponseOptions.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Watchdog()100%11100%
get_MaxInboundMessageChars()100%11100%

File(s)

/_/src/AsyncResponse.Core/AsyncResponseOptions.cs

#LineLine coverage
 1namespace AsyncResponse;
 2
 3/// <summary>
 4/// Engine-level options for AsyncResponse, configured by <c>AddAsyncResponse()</c>. These apply
 5/// regardless of which channel, transport, or durable-flow store is registered. Component-specific
 6/// settings live on that component's own <c>With*</c> registration — see
 7/// <see cref="InMemoryAsyncResponseOptions"/> and the Redis channel package's <c>RedisAsyncResponseOptions</c>.
 8/// </summary>
 9public sealed class AsyncResponseOptions
 10{
 11    /// <summary>
 12    /// Settings for the built-in recovery-state watchdog, which runs by default and periodically
 13    /// scans the configured recovery store for flows that look stuck (persisted recovery state
 14    /// with no live waiter). Set <see cref="AsyncResponseWatchdogOptions.Enabled"/> to
 15    /// <c>false</c> to turn it off — for example in all but one host when several hosts share one
 16    /// durable store, to avoid duplicate scans and warnings.
 17    /// </summary>
 1215018    public AsyncResponseWatchdogOptions Watchdog { get; set; } = new();
 19
 20    /// <summary>
 21    /// Largest inbound message the ingress will process, in UTF-16 code units. Larger messages are
 22    /// acknowledged without dispatch, with an error log and the
 23    /// <c>asyncresponse.ingress.oversized_messages</c> counter. Default: 8 Mi characters
 24    /// (comfortably above every broker's own payload ceiling); <c>null</c> removes the limit.
 25    /// <para>
 26    /// The backstop exists because the transport adapters materialize whatever the broker or
 27    /// database handed them as a string and parse it immediately. Without a bound, a handful of
 28    /// oversized messages could drive string, DOM, serializer and dead-letter allocations far past
 29    /// what the host budgeted for — and being poison, retry them into the same allocation over and
 30    /// over. This is a memory guard, not a business rule: put real payloads behind a claim check
 31    /// rather than raising it.
 32    /// </para>
 33    /// <para>
 34    /// Acknowledged rather than failed on purpose: an oversized message never becomes smaller, so
 35    /// redelivering it hot-loops (RabbitMQ's default <c>MaxDeliveryAttempts = 0</c> has no cap) or
 36    /// burns dead-letter attempts on brokers that do. Same answer this ingress already gives an
 37    /// unroutable correlation id, for the same reason.
 38    /// </para>
 39    /// </summary>
 1569540    public int? MaxInboundMessageChars { get; set; } = 8 * 1024 * 1024;
 41}