LiteBus
CatalogIngress

AWS SQS Inbox Ingress

  • ID: ingress.aws-sqs
  • Name: AWS SQS inbox ingress
  • Maturity: Beta
  • Summary: Polls an SQS queue and accepts messages into the inbox through shared transport ingress.

Purpose and Scope

UseAwsSqsIngress registers AwsSqsInboxIngressModule. The module maps the queue URL, ReceiveBatchSize, requeue policy, and shared safety record into transport ingress options. A root AwsSqsTransportModule supplies the SQS client.

SQS visibility timeout and delete-on-ack semantics are implemented in the transport consumer; ingress applies shared accept-then-ack ordering on top.

Beta Rationale

AWS SQS ingress has strong scenario coverage, including requeue on and off, but it remains Beta because:

  • Broker option surface is intentionally narrower than AMQP.
  • Telemetry assertions and FIFO-specific semantics are not yet covered as contract tests.

Public Surface

bus.AddAwsSqsTransport(sqsOptions);
bus.AddInbox(inbox => inbox.UseAwsSqsIngress(ingress =>
{
    ingress.UseOptions(new AwsSqsInboxIngressOptions
    {
        Destination = queueUrl,
        ReceiveBatchSize = 10,
        RequeueOnFailure = true,
        Safety = new TransportInboxIngressSafetyOptions
        {
            MaxInFlightMessages = 1
        }
    });
}));
Builder APIRole
InboxModuleBuilder.UseAwsSqsIngress(Action<AwsSqsInboxIngressModuleBuilder>)Registration extension
AwsSqsInboxIngressModuleBuilder.UseOptions(AwsSqsInboxIngressOptions)Queue URL and ingress behavior
AwsSqsInboxIngressModuleBuilder.DisableIngressConsumer()Handler without poll loop
AwsSqsInboxIngressModuleChild module

AWS Options and Parity vs AMQP

CapabilityAWS SQS ingressAMQP ingress
Destination requiredDestination (queue URL) requiredQueueName required
Root transport requiredAddAwsSqsTransport(...)AddAmqpTransport(...)
Native receive controlReceiveBatchSize, 1 through 10PrefetchCount, 0 through 65535
RequeueOnFailure toggleyes (default true)yes (default true)
Shared Safety settingsyesyes
Declare destination knobsnoyes

Packages

  • LiteBus.Inbox.Ingress.AwsSqs
  • LiteBus.Transport.AwsSqs (explicit root transport)

Requires

  • ingress.registration
  • Shared ingress capabilities
  • transport.aws-sqs
  • Inbox storage and contracts

Invariants

  • Destination (queue URL) and root AddAwsSqsTransport(...) are required at compose time.
  • Standard LiteBus wire headers required for contract resolution.
  • Beta tier per v6 feature index.
  • ReceiveBatchSize is validated from 1 through 10 at composition, matching the AWS SDK for .NET v4 ReceiveMessageRequest contract.
  • Identity and idempotency default to broker-scoped values (Safety.RequireStableIdentity=true, Safety.TrustApplicationHeaders=false).

Non-Goals

  • SNS fan-out configuration (application wiring).
  • FIFO ordering guarantees beyond SQS and transport adapter behavior.
  • GA tier declaration.

Observability

Ingress Metrics

InstrumentWhen incremented
ingress.ack_failed_after_acceptSQS delete-on-ack fails after inbox accept

Meter LiteBus.Inbox via AddLiteBusInboxMetrics().

Transport Tracing and Metrics

SignalBroker tagRegistration
process {destination} activityaws_sqsAddLiteBusTransportInstrumentation()
litebus.transport.circuit_breaker.opensqsTransport metrics from the root adapter
litebus.transport.circuit_breaker.failure_countsqssame

Visibility timeout and delete semantics are transport-layer; ingress applies accept-then-ack ordering on top.

Structured Logs

EventId 3002, 3003, 3004 from TransportInboxIngressLogMessages.

Identity, Idempotency, and Trusted Headers

SQS ingress uses shared mapper defaults:

SettingDefaultResult
RequireStableIdentitytrueMissing broker id fails closed
Safety.TrustApplicationHeadersfalseApp idempotency and tenant headers are ignored
Broker-scoped idempotency keyingress:{destination}:{brokerMessageId}Duplicate SQS deliveries map to same inbox dedup key when id is stable

Test Coverage

Covered

Test methodProject
PublishThroughSqs_ShouldAcceptProcessAndDispatchCommandLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
UnknownContract_ShouldNotWriteToStoreLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
InvalidJson_ShouldNotWriteToStoreLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
StoreFull_ShouldDrainQueueAndKeepPrefilledRowLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
RequeueEnabled_WithTransientStoreFailure_ShouldEventuallyAcceptLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
RequeueDisabled_WithPoisonMessage_ShouldDrainQueueLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
DuplicateMessageId_ShouldCreateSingleInboxRowLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
MissingContractName_ShouldDiscardWithoutStoreWriteLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
WrongContractVersion_ShouldDiscardWithoutStoreWriteLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
InvalidMessageId_ShouldAcceptWithGeneratedInboxIdLiteBus.Durable.IntegrationTests (Ingress/AwsSqs/)
InboxIngressExtensions_ShouldRegisterIngressServicesLiteBus.Durable.IntegrationTests (Registration/)

Untested

  • SQS FIFO ordering and deduplication semantics.
  • Delete-on-ack failure with ingress.ack_failed_after_accept metric assertion.
  • ReceiveBatchSize = 10 under sustained LocalStack load.
  • Broker-suite assertion for missing contract version and wrong CLR shape (covered in InMemory suite).

Out-of-Scope

  • SNS fan-out configuration (application wiring).
  • FIFO ordering guarantees beyond SQS and transport adapter behavior.
  • GA tier declaration.

Deep Docs

On this page