Class Producer

Constructors

Properties

batchSize: number
queueUrl: string
sqs: SQSClient
region?: string
create: ((options) => Producer)

Type declaration

Methods

  • Returns the number of messages in the queue.

    Returns Promise<number>

    A promise that resolves to the number of messages in the queue.

  • Send a message to the queue.

    Parameters

    • messages: string | Message | (string | Message)[]

      A single message or an array of messages.

    Returns Promise<SendMessageBatchResultEntry[]>

    A promise that resolves to the result of the send operation.

  • Send a batch of messages to the queue.

    Parameters

    • Optional failedMessages: string[]

      An array of failed message IDs.

    • Optional successfulMessages: SendMessageBatchResultEntry[]

      An array of successful message results.

    • Optional messages: (string | Message)[]

      An array of messages to send.

    • Optional startIndex: number

      The index of the first message in the batch.

    Returns Promise<SendMessageBatchResultEntry[]>

    A promise that resolves to the result of the send operation.

    Throws

    FailedMessagesError

  • Validate the producer options.

    Parameters

    Returns void

    Throws

    Error if any required options are missing or invalid.