Amazon SQS Send Messages activity¶
Introduction¶
An Amazon SQS Send Messages activity, using its Amazon SQS connection, sends messages from an Amazon SQS queue and is intended to be used as a target in an operation.
This activity uses the SendMessageBatch action from the Amazon SQS API.
Prerequisites¶
To successfully use this activity, you must have the following AWS IAM account permissions:
sqs:GetQueueUrl
sqs:ListQueues
sqs:SendMessage
Cross-account permissions don't apply to this action. For more information, see Basic Examples of Amazon SQS Policies in the Amazon SQS Developer Guide.
Create an Amazon SQS Send Messages activity¶
An instance of an Amazon SQS Send Messages activity is created from an Amazon SQS connection using its Send Messages activity type.
To create an instance of an activity, drag the activity type to the design canvas or copy the activity type and paste it on the design canvas. For details, see Creating an activity instance in Component reuse.
An existing Amazon SQS Send Messages activity can be edited from these locations:
- The design canvas (see Component actions menu in Design canvas).
- The project pane's Components tab (see Component actions menu in Project pane Components tab).
Configure an Amazon SQS Send Messages activity¶
Follow these steps to configure an Amazon SQS Send Messages activity:
-
Step 1: Enter a name, select a queue, and specify settings
Provide a name for the activity, select a queue, and specify the message content and settings for sending. -
Step 2: Review the data schemas
Any request or response schemas generated from the endpoint are displayed.
Step 1: Enter a name, select a queue, and specify settings¶
In this step, provide a name for the activity, select a queue, and specify the message content and settings for sending.
Tip
Fields with a variable icon support using global variables, project variables, and Jitterbit variables. Begin either by typing an open square bracket [
into the field or by clicking the variable icon to display a list of the existing variables to choose from.
-
Name: Enter a name to identify the activity. The name must be unique for each Amazon SQS Send Messages activity and must not contain forward slashes (
/
) or colons (:
). -
Select a Queue: This section displays queues available in the Amazon SQS endpoint. When reopening an existing activity configuration, only the selected queue is displayed instead of reloading the entire queue list.
-
Selected Queue: After a queue is selected, it is listed here.
-
Search: Enter any column's value into the search box to filter the list of queues. The search is not case-sensitive. If queues are already displayed within the table, the table results are filtered in real time with each keystroke. To reload queues from the endpoint when searching, enter search criteria and then refresh, as described below.
-
Refresh: Click the refresh icon or the word Refresh to reload queues from the Amazon SQS endpoint. This may be useful if queues have been added to Amazon SQS. This action refreshes all metadata used to build the table of queues displayed in the configuration.
-
Selecting a Queue: Within the table, click anywhere on a row to select a queue. Only one queue can be selected. The information available for each queue is fetched from the Amazon SQS endpoint:
-
Name: The queue name from Amazon SQS.
-
Description: The queue description from Amazon SQS.
-
Tip
If the table does not populate with available queues, the Amazon SQS connection may not be successful. Ensure you are connected by reopening the connection and retesting the credentials.
-
-
Message Body: Enter the message to send.
-
Message ID: Enter a unique identifier for the message. The connector uses this value as part of message batching. This is not to be confused with the system-assigned identifier Amazon SQS returns for sent messages.
-
Message Group ID: Enter a tag used to associate a message to a specific message group. This field applies only to FIFO (first-in-first-out) queues. For more information, see Using the Amazon SQS Message Group ID.
-
Message Duplication ID: Enter a token used for deduplication of sent messages. This field applies only to FIFO (first-in-first-out) queues. For more information, see Using the Amazon SQS Message Deduplication ID.
-
Message Delay in Seconds: Enter the length of time in seconds to delay the message. This can range from 0 to 900 seconds.
-
Continue on Error: Select to continue the activity execution if an error is encountered for a dataset in a batch request. If any errors are encountered, they are written to the operation log. It is selected by default.
-
Save & Exit: If enabled, click to save the configuration for this step and close the activity configuration.
-
Next: Click to temporarily store the configuration for this step and continue to the next step. The configuration will not be saved until you click the Finished button on the last step.
-
Discard Changes: After making changes, click to close the configuration without saving changes made to any step. A message asks you to confirm that you want to discard changes.
Step 2: Review the data schemas¶
Any request or response schemas generated from the endpoint are displayed.
-
Data Schemas: These data schemas are inherited by adjacent transformations and are displayed again during transformation mapping.
Note
Data supplied in a transformation takes precedence over the activity configuration.
The Amazon SQS connector uses the AWS SDK for Java version 1.12.522. Refer to the API documentation for information on the schema nodes and fields.
The request and response data schemas consist of these nodes and fields:
-
Request:
Request Schema Node/Field Amazon SQS API Field/Method Description sendMessagesRequest
SendMessageBatchRequest Request to send messages on a queue request
N/A (Request Node) Node representing the request queueUrl
QueueUrl String with the URL of the queue to send messages to entries
SendMessageBatchRequestEntry (List) List of messages to send id
MessageId String with a unique identifier for the message messageBody
MessageBody String with the body of the message delaySeconds
DelaySeconds Integer with the message sending delay in seconds messageAttributes
MessageAttribute (List) List of attributes to send with the message attrName
Name String with the name of the attribute stringValue
Value When dataType
is set tostring
, enter the value of the attribute (this value is returned as theJMSCorrelationID
in a Receive message activity's response)dataType
Type String with the data type of the attribute binaryValue
Value When dataType
is set tobinary
, enter the value of the attribute in a Base64-encoded format (this value is returned as theJMSCorrelationID
in a Receive message activity's response)messageDeduplicationId
MessageDeduplicationId String with a token used for FIFO queue message deduplication messageGroupId
MessageGroupId String with a token used for grouping messages in a FIFO queue -
Response:
Response Schema Node/Field Amazon SQS API Field/Method Description sendMessagesResponse SendMessageBatchResponse Response from sending messages on a queue response N/A (Response Node) Node representing the response successful SendMessageBatchResultEntry (List) List of sent messages returned with the response id Id String set to an internal batch identifier for the message messageId MessageId String set to a unique identifier for the message mD5OfMessageBody MD5OfMessageBody String set to the MD5 digest of the non-URL-encoded message body mD5OfMessageAttributes MD5OfMessageAttributes String set to the MD5 digest of the non-URL-encoded message attributes failed BatchResultErrorEntry (List) List of messages that failed to send id Id String set to an internal batch identifier for the message senderFault SenderFault Boolean set to whether or not the error happened due to the sender code Code String set to a code representing why the message failed to send message Message String set to a message explaining why the message failed to send
Note
Refer to the SendMessageBatch action for detailed information on the schema nodes and fields.
-
-
Refresh: Click the refresh icon or the word Refresh to regenerate schemas from the Amazon SQS endpoint. This action also regenerates a schema in other locations throughout the project where the same schema is referenced, such as in an adjacent transformation.
-
Back: Click to temporarily store the configuration for this step and return to the previous step.
-
Finished: Click to save the configuration for all steps and close the activity configuration.
-
Discard Changes: After making changes, click to close the configuration without saving changes made to any step. A message asks you to confirm that you want to discard changes.
Next steps¶
After configuring an Amazon SQS Send Messages activity, complete the configuration of the operation by adding and configuring other activities, transformations, or scripts as operation steps. You can also configure the operation settings, which include the ability to chain operations together that are in the same or different workflows.
Menu actions for an activity are accessible from the project pane and the design canvas. For details, see Activity actions menu in Connector basics.
Amazon SQS Send Messages activities can be used as a target with these operation patterns:
- Transformation pattern
- Two-transformation pattern (as the first or second target)
To use the activity with scripting functions, write the data to a temporary location and then use that temporary location in the scripting function.
When ready, deploy and run the operation and validate behavior by checking the operation logs.