Features | Pricing | Documentation | Contact | Blog | About

SQS Destinations

Service Name: Simple Queue Service (SQS)
ARN Format: arn:aws:sqs:{region}:{account}:{name of queue}
Style: Async (Write)
Actions (required Permissions): sqs:GetQueueUrl,
sqs:SendMessage (grants access to sqs:SendMessageBatch as well)
Payload Format: JSON Packet, one message per packet
Arguments: SendRaw (boolean, default: false),
UseMessageAttributes (boolean, default: false),
MessageGroupIdExpression (binary range expression, optional),
MessageGroupIdFormatter (string, default: "hex"),
MessageDeduplicationIdExpression (binary range expression, optional),
MessageDeduplicationIdFormatter (string, default: "hex")

Proxylity's integration with SQS writes batches of packets arriving at your listener as messages to your queue. Writing packets to SQS allows delayed handling for moderate to high rate workloads, decoupling packet receipt from processing and enabling horizontal scaling of your backend systems. Standard, FIFO, and Fair queues are all supported with specialized configuration options for ordering and deduplication.

Technical Details

UDP Gateway uses the sqs:SendMessageBatch API to efficiently write packets to your queue. This batch API allows up to 10 messages to be sent in a single API call, reducing costs and improving throughput when handling high packet rates.

Important: While UDP Gateway batches packets for efficient transmission to SQS, each SQS message contains exactly one packet. When your application receives messages from the queue, each message body will be a single JSON packet object, not an array. This design ensures that individual packets can be processed independently, retried separately if processing fails, and distributed across multiple consumers for parallel processing.

The message body contains the complete request packet with all metadata including source/destination addresses, arrival time, and the UDP payload data. Your queue consumers can process these messages using standard SQS polling techniques, Lambda event source mappings, or any other SQS-compatible processing framework.

Message Format Options

The SQS destination supports two configuration options that control how packet data is formatted in queue messages:

SendRaw

SendRaw (boolean, default: false) - When set to true, the raw binary UDP payload is sent as the message body without JSON wrapping. When false (default), the message body contains the full JSON packet object with metadata.

UseMessageAttributes

UseMessageAttributes (boolean, default: false) - When set to true, packet metadata (source IP/port, destination IP/port, timestamp, etc.) is sent as SQS message attributes instead of being included in the JSON body. This option is only meaningful when SendRaw is false.

FIFO and Fair Queue Support

SQS FIFO queues preserve the order of messages and provide exactly-once processing, making them ideal for scenarios where packet ordering matters. AWS Fair queues provide fair processing across message groups with improved throughput compared to FIFO queues. UDP Gateway provides specialized configuration options for working with both queue types.

Message Group ID

Both FIFO and Fair queues require a message group ID. For FIFO queues, the message group ID provides ordering guarantees within each group. For Fair queues, it enables fair processing distribution across groups. UDP Gateway supports two approaches for specifying the message group ID:

Message Deduplication ID

FIFO queues support content-based deduplication to prevent duplicate message processing. UDP Gateway allows you to dynamically extract deduplication IDs from packet payloads:

FIFO Example Configuration (JSON)

{
  "DestinationArn": "arn:aws:sqs:us-east-1:123456789012:my-queue.fifo",
  "Arguments": {
    "MessageGroupIdExpression": "[0:4]",
    "MessageGroupIdFormatter": "hex",
    "MessageDeduplicationIdExpression": "[4:8]",
    "MessageDeduplicationIdFormatter": "hex"
  }
}

This configuration extracts the first 4 bytes as the message group ID and bytes 4-8 as the deduplication ID, both formatted as hexadecimal strings.

Best Practices

Example Use Cases

Example Code

An example demonstrating both Standard and FIFO queue configurations is available in the SQS example in our GitHub examples repository. The example includes CloudFormation templates showing how to configure both queue types with different delivery options.