Messaging and events

Amazon SQS integration

Amazon Simple Queue Service (SQS) is a fully managed message queue in AWS. Applications built on AWS use it to pass work between services. ECOM sends partner documents to SQS queues and turns queued messages into EDI and API calls.

Provider
Amazon Web Services
Queue types
Standard and FIFO
Access control
AWS IAM policies
Failure handling
Visibility timeout, dead-letter queues
Where Amazon SQS fitsA hub diagram: AWS services, Lambda functions, SNS and EventBridge, and S3 events exchange SQS messages with the ECOM B2B gateway, which handles standard and FIFO queues, visibility timeouts and dead-letter queues and maps messages for the ERP, warehouse, EDI partners and APIs.Where Amazon SQS fitsPartners, the ECOM gateway and your systemsAWS SOURCESAWS servicesLambda functionsSNS and EventBridgeS3 eventsDESTINATIONSERPWarehouse (WMS)EDI partnersAPIs and appsECOM B2B gatewayAmazon SQSStandard and FIFOVisibility and DLQMap messages
Where Amazon SQS fitsA hub diagram: AWS services, Lambda functions, SNS and EventBridge, and S3 events exchange SQS messages with the ECOM B2B gateway, which handles standard and FIFO queues, visibility timeouts and dead-letter queues and maps messages for the ERP, warehouse, EDI partners and APIs.Where Amazon SQS fitsPartners, the ECOM gateway and your systemsAWS SOURCESAWS servicesLambda functionsSNS and EventBridgeS3 eventsECOM B2B gatewayAmazon SQSStandard and FIFOVisibility and DLQMap messagesDESTINATIONSERPWarehouse (WMS)EDI partnersAPIs and apps

Messages from AWS services pass through SQS; the gateway turns them into partner documents and back.

Expand diagram Download SVG

Overview

What Amazon SQS is

SQS stores messages until a consumer receives and deletes them. Standard queues offer at-least-once delivery with best-effort ordering, so a message can occasionally arrive twice or out of order. FIFO queues keep order within a message group and remove duplicates within a deduplication window.

When a consumer receives a message, it becomes invisible for the visibility timeout. If the consumer deletes it in time, it is gone; if not, it reappears for another try. After a set number of failed receives, it moves to a dead-letter queue.

Where businesses use it

  • AWS applications

    Services on AWS that hand off orders and tasks through queues.

  • Buffering bursts

    Absorbing peaks, such as order surges, so downstream systems keep up.

  • Event fan-out

    Combined with SNS or EventBridge to deliver one event to several queues.

How it works

How an SQS exchange works

A producer sends a message, with optional attributes, to the queue URL using credentials allowed by IAM. A consumer polls with long polling, receives a batch of messages, processes each, and deletes it.

Message size is limited, so large documents are usually stored in Amazon S3 and the message carries a reference. FIFO queues need a message group ID and a deduplication ID.

An order through an SQS FIFO queueA sequence diagram: the ECOM gateway sends an order message with a group ID and deduplication ID to a FIFO queue, the consumer receives it, which hides it for the visibility timeout, processes it and deletes it; after repeated failures it moves to the dead-letter queue.An order through an SQS FIFO queueSend, receive, deleteECOM gatewaySQS queueConsumerSendMessage (group ID, dedupe ID)ReceiveMessage (long poll)Hidden for visibility timeoutDeleteMessage after processingToo many failures: DLQ
An order through an SQS FIFO queueA sequence diagram: the ECOM gateway sends an order message with a group ID and deduplication ID to a FIFO queue, the consumer receives it, which hides it for the visibility timeout, processes it and deletes it; after repeated failures it moves to the dead-letter queue.An order through an SQS FIFOqueueSend, receive, deleteECOMgatewaySQS queueConsumerSendMessage (group ID,dedupe ID)ReceiveMessage (longpoll)Hidden for visibilitytimeoutDeleteMessage afterprocessingToo many failures:DLQ

The message is hidden while being processed and deleted when done. If processing keeps failing, it moves to the dead-letter queue.

Expand diagram Download SVG

In depth

SQS integration in practice

  • Standard or FIFO

    FIFO where order and deduplication matter; standard where throughput matters and consumers handle duplicates.

  • Visibility timeout

    Set longer than processing takes, so messages are not processed twice by accident.

  • Dead-letter queues

    Messages that keep failing are moved aside for review and redrive.

  • Large payloads

    Documents are stored in S3 with a reference in the message.

  • IAM and encryption

    Least-privilege IAM roles and server-side encryption protect queues.

  • Idempotent consumers

    Consumers check document IDs so a repeated message does no harm.

In practice

Example: AWS order service to a 3PL by EDI

An order service on AWS places fulfillment requests on SQS. The 3PL needs X12 940s.

Example: AWS order service to a 3PL by EDIFive steps: the order service queues a request on SQS, the gateway receives it, maps it to an X12 940, sends it to the 3PL by AS2, and deletes the message.Example: AWS order service to a 3PL by EDIA practical example, step by step1Queue therequestThe order servicesends a message toSQS.Step 12ReceiveThe gatewayreceives it with longpolling.Step 23Map to 940It becomes the3PL's warehouseorder.Step 34Send by AS2The 940 goes to the3PL.Step 45DeleteThe message isdeleted once sent.Step 5
Example: AWS order service to a 3PL by EDIFive steps: the order service queues a request on SQS, the gateway receives it, maps it to an X12 940, sends it to the 3PL by AS2, and deletes the message.Example: AWS order service to a3PL by EDIA practical example, step by step1Queue the requestThe order service sends a message toSQS.Step 12ReceiveThe gateway receives it with longpolling.Step 23Map to 940It becomes the 3PL's warehouse order.Step 34Send by AS2The 940 goes to the 3PL.Step 45DeleteThe message is deleted once sent.Step 5

Deleting only after the 940 is sent means nothing is lost if a step fails.

Expand diagram Download SVG

Connections

How Amazon SQS connects your business

  • Trading partners

    EDI documents from partners become SQS messages for internal systems, and events become partner documents.

  • ERP and business systems

    Orders, shipments, inventory and invoices move between applications as events, without point-to-point links.

  • APIs and files

    The same data can be published to APIs or written to files for systems that do not read the platform.

  • Business workflows

    Order-to-cash and fulfillment steps react to events as they happen.

ECOM

How ECOM supports Amazon SQS

ECOM supports Amazon SQS with dedicated implementation, mapping, communication and support teams, and with specialists who know the industries your partners work in.

  • Implementation team

    Plans the Amazon SQS setup with you, configures it on the gateway and runs the tests with your partners and systems.

  • Mapping team

    Builds and maintains the maps, code conversions and validation rules between partner data and your applications.

  • Communication team

    Sets up and monitors partner connections, certificates, keys and credentials, and coordinates changes with each partner.

  • Support team

    Watches the flows, investigates failed or missing documents, and works the issue through with you and your partner.

For Amazon SQS in particular

  • SQS producers and consumers with IAM roles, FIFO settings, dead-letter queues and S3 payload handling.
  • Mapping between SQS messages and EDI, XML, JSON, files and your ERP, with validation.
  • Monitoring of queues, subscriptions and failed messages, with alerts and a clear path to reprocess.

Frequently asked questions

What is the difference between standard and FIFO queues?

Standard queues deliver at least once with best-effort ordering. FIFO queues keep order within a message group and remove duplicates within a deduplication window.

What is the visibility timeout?

The time a received message stays hidden from other consumers. If it is not deleted in that time, it becomes visible again for another attempt.

How are large EDI files handled?

The file is stored in Amazon S3 and the SQS message carries a reference to it.

How is access controlled?

With AWS IAM policies that allow only the actions each component needs, plus encryption of the queue.

Talk to an EDI/API Expert

Tell us which partners, systems and Amazon SQS requirements you are working with. An ECOM specialist will review them with you and outline the setup, the maps and the tests.