Contact Free trial Login

Amazon SQS Connector 5.8 Additional Configuration Information - Mule 4

Receiving Messages on the Primary Node Only

The default behavior of the Receive Messages source is to receive messages on all nodes when running in cluster mode.

If you want the app to receive messages on the primary node only:

  1. In Studio, select the Receive Messages source for your flow.

  2. On the Advanced sub-tab of the Receive messages tab, select the Primary node only checkbox:

    Read message configuration Advanced tab with Primary node only option selected

The multi-node cluster behavior depends on the selected SQS queue type. When using the Standard queue, SQS guarantees that a message is delivered at least once. However, duplicate messages might be introduced in the queue. To avoid duplication of messages in the queue, you can use a FIFO (First-In-First-Out) queue to ensure that a message is delivered only once and that it remains available until a consumer processes and deletes it.

For more information about queue types, see AWS SQS Stanard Queues and AWS SQS FIFO Queues.

Creating the FIFO Queue

FIFO queues deliver messages in the order in which they are sent.

To create the FIFO queue, use the Create queue operation in the connector, and set the FifoQueue and ContentBasedDeduplication field values to true.

End the queue name value with the .fifo extension, for example:
MyTestFIFOQueue.fifo.

When you create the FIFO queues, select any of the 15 regions that Amazon supports.

When you use Amazon SQS Connector to send messages to the FIFO queue, use the same queue URL and region name that you used when creating the FIFO queue. You must also provide a value for the attribute message group id in the connector configuration while sending messages.

Managing Large Payloads

To enable support for managing large message payloads in Amazon SQS Connector, follow these steps:

  1. In Studio, click the Global Elements tab at the base of the canvas.

  2. Select the Amazon SQS Configuration you previously created and click Edit.

  3. In the Connection section, click the Advanced tab.

  4. In the Large Payload Support field, choose either:

    • Expression or Bean Reference

    • Edit Inline

      Configure Large Payload Support
  5. Configure the parameters as follows:

    Field Description

    Bucket

    Name of the bucket to use for storing large message payloads. The bucket must already be created and configured in AWS S3. Enabling this feature incurs additional charges for using AWS S3.

    Message Size Threshold

    Message size threshold value for storing message payloads in the AWS S3 bucket. The default value for message size threshold is 256 KB and the maximum threshold size value is 256KB. The maximum message size is 2GB.

    Message Size Threshold Unit

    Represents the data unit for the message size threshold.

    After you specify the values for these fields, Amazon SQS Connector is ready to manage large payload messages and store them automatically in the specified AWS S3 bucket when the message size threshold value is exceeded.

For an example of sending and receiving messages with large payload messages, see Send and Receive Large Messages Example.

Next

After you create the FIFO queue, you can try the Amazon SQS Connector Examples.