Runax.Messaging.Transports.Aws.Sqs
2.0.0
dotnet add package Runax.Messaging.Transports.Aws.Sqs --version 2.0.0
NuGet\Install-Package Runax.Messaging.Transports.Aws.Sqs -Version 2.0.0
<PackageReference Include="Runax.Messaging.Transports.Aws.Sqs" Version="2.0.0" />
<PackageVersion Include="Runax.Messaging.Transports.Aws.Sqs" Version="2.0.0" />
<PackageReference Include="Runax.Messaging.Transports.Aws.Sqs" />
paket add Runax.Messaging.Transports.Aws.Sqs --version 2.0.0
#r "nuget: Runax.Messaging.Transports.Aws.Sqs, 2.0.0"
#:package Runax.Messaging.Transports.Aws.Sqs@2.0.0
#addin nuget:?package=Runax.Messaging.Transports.Aws.Sqs&version=2.0.0
#tool nuget:?package=Runax.Messaging.Transports.Aws.Sqs&version=2.0.0
Runax.Messaging.Transports.Aws.Sqs
Amazon SQS transport for Runax.Messaging. Topics map to SQS queues (by name, or by an explicit queue-URL mapping).
Install
dotnet add package Runax.Messaging
dotnet add package Runax.Messaging.Transports.Aws.Sqs
Register
Attach the transport to a bus with its config object:
using Runax.Messaging;
using Runax.Messaging.Transports.Aws.Sqs;
builder.Services.AddRunaxMessaging(messaging =>
{
messaging.AddBus(bus =>
{
bus.AddTransport(new SqsConfig
{
Region = "us-east-1",
});
bus.AddConsumer<OrderPlacedConsumer>();
});
});
SqsConfig lives in the Runax.Messaging.Transports.Aws.Sqs namespace, so add that using.
The config is validated at startup (DataAnnotations, when the AddBus block completes); bind it
from an IConfiguration section instead of setting properties:
bus.AddTransport<SqsConfig>(builder.Configuration.GetSection("Sqs")).
Config
Set these directly on SqsConfig.
| Property | Meaning | Default | Required? |
|---|---|---|---|
Region |
AWS region. | us-east-1 |
No |
AccessKey |
Access key. If null (with SecretKey), the default AWS credential chain is used. |
null |
No |
SecretKey |
Secret key. If null (with AccessKey), the default AWS credential chain is used. |
null |
No |
ServiceUrl |
Custom endpoint, e.g. for LocalStack or testing. | null |
No |
MaxNumberOfMessages |
Maximum messages received per poll (1–10). | 10 |
No |
WaitTimeSeconds |
Long-polling wait time in seconds (0–20). | 20 |
No |
MaxConcurrentMessages |
Maximum messages handled concurrently across all polled queues. | 10 |
No |
VisibilityTimeoutSeconds |
Visibility timeout requested per receive (0–43200), hiding the message while it is processed. | 30 |
No |
ExtendVisibilityDuringProcessing |
Periodically extend visibility while a message is handled (including retry backoff) so it does not reappear and get processed twice. | true |
No |
TopicQueueUrlMap |
Explicit topic → queue-URL map. Unmapped topics are resolved by queue name via GetQueueUrl. |
empty | No |
RegisterHealthCheck |
Auto-register the runax:{bus} health check (inherited from TransportConfig). |
true |
No |
Beyond the transport config, settings from the core package apply to the bus that runs this
transport — AddConsumer<T>(), WithRetry(...), OnUnroutableMessage(...),
ConfigureSerialization(...), and UseSerializer<T>() — all inside the same AddBus block.
Two SQS accounts (or regions) are simply two buses, each with its own SqsConfig. See
Configuration & per-bus settings.
Behavior
- Publish sends the serialized envelope to the resolved queue. Batch publish
(
PublishBatchAsync) usesSendMessageBatch, chunked at the SQS limit of 10 per call. - Subscribe runs one pump per queue in parallel and dispatches messages continuously,
bounded by
MaxConcurrentMessages(so successive polls overlap rather than draining one batch at a time). Each message maps the dispatch verdict to the queue:Acknowledge→DeleteMessageRequeueandDeadLetter→ leave the message so its visibility timeout lapses and SQS redelivers it, routing to a configured redrive DLQ oncemaxReceiveCountis reached
- While a message is being handled, the transport extends its visibility timeout
(
ExtendVisibilityDuringProcessing) so in-process retry backoff does not let it reappear on the queue.
For native dead-lettering, configure a redrive policy on the queue and set
bus.WithRetry(o => o.Strategy = DeadLetterStrategy.BrokerNative) on the bus.
Health check
A reachability check named runax:{bus} is registered automatically for each bus that runs
this transport. Opt out per bus:
bus.AddTransport(new SqsConfig { Region = "us-east-1", RegisterHealthCheck = false });
Telemetry
The transport reports messaging.system = "sqs" on the spans and metrics emitted
by the core package (activity source / meter "Runax.Messaging"); the
messaging.runax.bus tag identifies the bus.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AWSSDK.SQS (>= 4.0.100.12)
- Microsoft.Extensions.Configuration (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- Runax.Messaging.Abstractions (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.