prorm API Reference
    Preparing search index...

    Class SqsStore

    SqsStore wraps an AWS v3 SQSClient and exposes queue sending, a receive-and-ack poll loop, and queue administration.

    Implements

    Index
    name: "sqs" = 'sqs'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "@aws-sdk/client-sqs" = '@aws-sdk/client-sqs'

    The client library being used

    • SendMessage — publish one message to the queue at queueUrl. The message is encoded to a string body (string as-is, Buffer → UTF-8, else JSON). Returns the message id (and FIFO sequence number, if any).

      Parameters

      • queueUrl: string
      • message: SqsMessage
      • options: SendMessageOptions = {}

      Returns Promise<SendMessageResult>

    • CreateQueue — create a queue by name. Returns its URL.

      Parameters

      • name: string
      • options: CreateQueueOptions = {}

      Returns Promise<string | undefined>

    • Alias for createQueue(), matching the common store surface.

      Parameters

      • name: string
      • options: CreateQueueOptions = {}

      Returns Promise<string | undefined>

    • Subscribe to the queue at queueUrl: long-poll ReceiveMessage in a loop, invoke handler once per message, and (by default) DeleteMessage to ack each message after the handler resolves. Returns a subscription whose stop() ends the loop; the subscription is tracked so disconnect() stops it. The loop runs detached (not awaited); this method resolves immediately.

      Parameters

      • queueUrl: string
      • handler: (message: any) => void | Promise<void>
      • options: SqsSubscribeOptions = {}

      Returns SqsSubscription